summaryrefslogtreecommitdiff
path: root/doc/source/contributor/functional_tests.rst
blob: 1e3f239c42411312a21bfcc5d4b7b966ef4ec228 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
================
Functional Tests
================

Cinderclient contains a suite of functional tests, in the cinderclient/
tests/functional directory.

These are currently non-voting, meaning that zuul will not reject a
patched based on failure of the functional tests. It is highly recommended,
however, that these tests are investigated in the case of a failure.

Running the tests
-----------------
Run the tests using tox, via the tox.ini file.  To run all
tests simply run::

    tox -e functional

This will create a virtual environment, load all the packages from
test-requirements.txt and run all unit tests as well as run flake8 and hacking
checks against the code.

Note that you can inspect the tox.ini file to get more details on the available
options and what the test run does by default.

Running a subset of tests using tox
-----------------------------------
One common activity is to just run a single test, you can do this with tox
simply by specifying to just run py27 or py34 tests against a single test::

    tox -e functional -- -n cinderclient.tests.functional.test_readonly_cli.CinderClientReadOnlyTests.test_list

Or all tests in the test_readonly_clitest_readonly_cli.py file::

    tox -e functional -- -n cinderclient.tests.functional.test_readonly_cli

For more information on these options and how to run tests, please see the
`stestr documentation <https://stestr.readthedocs.io/en/latest/index.html>`_.

Gotchas
-------

The cinderclient.tests.functional.test_cli.CinderBackupTests.test_backup_create
and_delete test will fail in Devstack without c-bak service running, which
requires Swift. Make sure Swift is enabled when you stack.sh by putting this in
local.conf::

    enable_service s-proxy s-object s-container s-account