3.2 KiB
Test suite structure
Test types
There are three types of tests for Zaqar:
- Unit tests
-
Unit tests check modules separately. For example, there are checks for each individual method that the storage layer provides.
- Functional tests
-
Functional tests verify that the service works as expected. In particular, in Zaqar they exercise the API endpoints and validate that the API responses conform to the specs. These include positive and negative tests.
- Tempest tests
-
Tempest tests are integration tests for OpenStack1.
Tempest tests for Zaqar are available in the Tempest repository.
Refer to running_tests document for details on how to run Unit
and Functional tests.
Refer to the Tempest repository for details on how to run Tempest tests.
Code structure
The test suite lives in zaqar/tests directory of
Zaqar:
zaqar/tests/etc-
Contains various configuration files for Zaqar. They help to test how Zaqar works in different configurations.
zaqar/tests/functional-
Contains functional tests.
zaqar/tests/unit-
Contains unit tests.
The base class of all test classes is located in the
zaqar/tests/base.py file.
Test invocation
When you run tests via tox -e py27 command in the root
directory of Zaqar:
Tox program executes:
- Looks for
tox.inifile. - Creates
.toxdirectory for storing python environments. - Parses this file and finds parameters for py27 testing environment.
- Sets this environment up and activates it.
- Sets environment variables for this environment that are described
in
tox.ini - In case of Zaqar it invokes Testr program in the environment.
You can find more information about Tox in OpenStack Tox testing manual and in official Tox documentation.
- Looks for
Testr (Test Repository) program executes:
- Looks for
testr.inifile. - Parses this file and finds parameters for executing tests.
- Creates
.testrepositorydirectory for storing statistics of executing tests. - In case of Zaqar it invokes
Subunitprogram which finds all tests and executes it.
You can find more information about Testr in OpenStack Testr manual.
- Looks for
Footnotes