blob: f3fa28e7cde36d45b08e5b93f1d7596d5bedc491 [file] [log] [blame]
James E. Blair9ab86622013-07-02 11:23:46 -07001===========================
2Testing Your OpenStack Code
3===========================
4------------
5A Quickstart
6------------
7
8This is designed to be enough information for you to run your first tests.
9Detailed information on testing can be found here: https://wiki.openstack.org/wiki/Testing
10
11*Install pip*::
12
13 [apt-get | yum] install python-pip
14More information on pip here: http://www.pip-installer.org/en/latest/
15
16*Use pip to install tox*::
17
18 pip install tox
19
20Run The Tests
21-------------
22
23*Navigate to the project's root directory and execute*::
24
25 tox
26Note: completing this command may take a long time (depends on system resources)
27also, you might not see any output until tox is complete.
28
29Information about tox can be found here: http://testrun.org/tox/latest/
30
31
32Run The Tests in One Environment
33--------------------------------
34
35Tox will run your entire test suite in the environments specified in the project tox.ini::
36
37 [tox]
38
39 envlist = <list of available environments>
40
41To run the test suite in just one of the environments in envlist execute::
42
43 tox -e <env>
44so for example, *run the test suite in py26*::
45
46 tox -e py26
47
48Run One Test
49------------
50
51To run individual tests with tox::
52
53 tox -e <env> -- path.to.module.Class.test
54
55For example, to *run the basic Zuul test*::
56
57 tox -e py27 -- tests.test_scheduler.TestScheduler.test_jobs_launched
58
59To *run one test in the foreground* (after previously having run tox
60to set up the virtualenv)::
61
62 .tox/py27/bin/python -m testtools.run tests.test_scheduler.TestScheduler.test_jobs_launched
63
64Need More Info?
65---------------
66
67More information about testr: https://wiki.openstack.org/wiki/Testr
68
69More information about nose: https://nose.readthedocs.org/en/latest/
70
71
72More information about testing OpenStack code can be found here:
73https://wiki.openstack.org/wiki/Testing