diff options
| author | Sergey Turivnyi <sturivnyi@mirantis.com> | 2015-11-02 16:16:59 +0200 |
|---|---|---|
| committer | Sergey Turivnyi <sturivnyi@mirantis.com> | 2015-11-18 11:10:01 +0200 |
| commit | f5c478b027f081a7e91231aecf8242dcacaee3d4 (patch) | |
| tree | 0134ae6020fce75178fb54ea42882be4635d42a2 /doc | |
| parent | b66f5e8dd60c023d6d216c3bbc5ec22d837623c3 (diff) | |
| download | python-ironicclient-f5c478b027f081a7e91231aecf8242dcacaee3d4.tar.gz | |
Add documentation on how to run tests
Added a testing page to the documentation.
This includes information on:
* Running PEP8 checks
* Running unit tests
* Running functional tests
Closes-bug:#1511731
Change-Id: I4a5cf4be98f32455e36ea7d6a45b18afca043809
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/source/index.rst | 1 | ||||
| -rw-r--r-- | doc/source/testing.rst | 67 |
2 files changed, 68 insertions, 0 deletions
diff --git a/doc/source/index.rst b/doc/source/index.rst index bef6b30..af7c233 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -15,6 +15,7 @@ Contents api_v1 cli contributing + testing Indices and tables ================== diff --git a/doc/source/testing.rst b/doc/source/testing.rst new file mode 100644 index 0000000..f45e1d6 --- /dev/null +++ b/doc/source/testing.rst @@ -0,0 +1,67 @@ +.. _testing: + +======= +Testing +======= + +Python Guideline Enforcement +............................ + +All code has to pass the pep8 style guideline to merge into OpenStack, to +validate the code against these guidelines you can run:: + + tox -e pep8 + +Unit Testing +............ + +It is strongly encouraged to run the unit tests locally under one or more +test environments prior to submitting a patch. To run all the recommended +environments sequentially and pep8 style guideline run:: + + tox + +You can also selectively pick specific test environments by listing your +chosen environments after a -e flag:: + + tox -e py27,py33,py34,pep8 + +.. note:: + Tox sets up virtual environment and installs all necessary dependencies. + Sharing the environment with devstack testing is not recommended due to + conflicting configuration with system dependencies. + +Functional Testing +.................. + +Functional testing assumes the existence of the script run_functional.sh in the +python-ironicclient/tools directory. The script run_functional.sh generates +test.conf file. To run functional tests just run ./run_functional.sh. + +Also, the test.conf file could be created manually or generated from +environment variables. It assumes the existence of an openstack +cloud installation along with admin credentials. The test.conf file lives in +ironicclient/tests/functional/ directory. To run functional tests in that way +create test.conf manually and run:: + + tox -e functional + +An example test.conf file:: + + [functional] + api_version = 1 + os_auth_url=http://192.168.0.2:5000/v2.0/ + os_username=admin + os_password=admin + os_tenant_name=admin + +If you are testing ironic in standalone mode, only the parameters +'auth_strategy', 'os_auth_token' and 'ironic_url' are required; +all others will be ignored. + +An example test.conf file for standalone host:: + + [functional] + auth_strategy = noauth + os_auth_token = fake + ironic_url = http://10.0.0.2:6385 |
