Testing

This page describes how to run tests on your Forseti contributions.

Before you begin

Before you run unit tests, install Forseti by following the Developer Setup for a local installation or the Google Cloud Platform (GCP) setup for a Compute Engine installation. You will need to connect to that instance to run the unit tests.


Executing tests

Unit tests are in the top-level tests/ directory. We use unittest from standard Python to run our tests.

Before you run unit tests and pylint checkers, make sure you have Docker CE installed.

Run the following commands in the top-level directory of Forseti.

Install Forseti in a docker image:

  ./install/scripts/docker_install_forseti.sh

Run all the unit tests:

  ./install/scripts/docker_unittest_forseti.sh

Run pylint checkers:

  ./install/scripts/docker_pylint_forseti.sh