zaqar/doc/source/test_suite.rst
Eva Balycheva b53ff5d12c Refactoring of docs during Mitaka cycle
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
2016-01-07 17:05:09 +03:00

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:

  1. Tox program executes:

    1. Looks for tox.ini file.
    2. Creates .tox directory for storing python environments.
    3. Parses this file and finds parameters for py27 testing environment.
    4. Sets this environment up and activates it.
    5. Sets environment variables for this environment that are described in tox.ini
    6. 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.

  2. Testr (Test Repository) program executes:

    1. Looks for testr.ini file.
    2. Parses this file and finds parameters for executing tests.
    3. Creates .testrepository directory for storing statistics of executing tests.
    4. 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.

Footnotes


  1. See http://docs.openstack.org/developer/tempest/overview.html↩︎