This patch improves Zaqar documentation and fixes currently existing bugs. Bugs this patch currently addresses and solutions: Short names for documentation locations used in this commit message: GitRepo - https://github.com/openstack/zaqar/ Contributor Docs - http://docs.openstack.org/developer/zaqar/ Wiki - https://wiki.openstack.org/wiki/Zaqar/ 1. DRY violation and spreaded information for contributors bug. The information for Zaqar contributors is spreaded/duplicated across GitRepo, Contributor Docs and Wiki. Examples of DRY violation are these three articles: https://wiki.openstack.org/wiki/Zaqar/Give_Zaqar_a_try, https://github.com/openstack/zaqar/blob/master/README.rst, http://docs.openstack.org/developer/zaqar/development-environment.html Example of spreaded information is: "zaqar/tests/functional/README.rst" Normally the contributor want to see the information from this file in "doc/source/running_tests.rst". Solution: move useful missing information for contributors from Wiki and GitRepo to Contributor Docs, then replace all contributor information in Wiki and GitRepo with links to Contributor Docs. 2. Outdated information, missing new information and broken links bug. Example is "test_suite.rst": a. It still states that Zaqar test suite lives in two directories - "tests" and "zaqar/tests", but now it's not true. b. Doesn't contain information about how test invocation is organized, what really happens when "tox -e py27" command executes. Solution: replace outdated information with new, fix broken links if possible, add useful missing information. 3. Style and formatting bugs. The reference is http://docs.openstack.org/contributor-guide/. Many documents in Contributor Docs have wrong line wrapping - some lines are wrapped too short and some are wrapped too long. Lines must wrap at 79 characters, exceptions are code and links. Example is "first_review.rst" which lines are not wrapped at all. Enumerated lists must be written using "#. " syntax. Example with wrong enumerated list is "development.environment.rst". Some inline elements must be styled according to: http://docs.openstack.org/contributor-guide/rst-conv/inline-markups.html Example with wrong styling of inline elements is "development.environment.rst" where many paths and file names are not marked with `` (double backticks). By default code inserts are implicitly styled with python syntax. There are many places in Contributor Docs where console (bash) code is wrongly styled with python syntax. Also there are some failed attempts to apply a formatting in Contributor Docs. For example there is a broken list in "first_review.rst" at line 52. Solution: fix broken formatting, apply proper style where it is needed. Some of these bugs fixes closes few bug reports from: https://etherpad.openstack.org/p/zaqar-mitaka-docs Change-Id: Id668684248bdee03eb43b537dc2c6bb2a68ed23d
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.ini
file. - Creates
.tox
directory 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.ini
file. - Parses this file and finds parameters for executing tests.
- Creates
.testrepository
directory for storing statistics of executing tests. - In case of Zaqar it invokes
Subunit
program which finds all tests and executes it.
You can find more information about Testr in Openstack Testr manual.
- Looks for
Footnotes