Documentation tox fix

Added information about debugging unit test with tox.
Replace 3 references to py26 with py34 to reflect current
rally tox configuration.

Co-Authored-By: Illia Khudoshyn <ikhudoshyn@mirantis.com>

Change-Id: I10c865fae473111b35dca1b9c8f51f31ba066b42
closes-bug: 1547265
This commit is contained in:
Luz 2016-02-18 16:47:37 -08:00 committed by Illia Khudoshyn
parent 723cacac8e
commit c8a00136c2
2 changed files with 40 additions and 3 deletions

View File

@ -64,7 +64,7 @@ Several Linux distributions (notably Fedora 16 and Ubuntu 12.04) are also starti
7. Start coding
8. Run the test suite locally to make sure nothing broke, e.g. (this will run py26/py27/pep8 tests):
8. Run the test suite locally to make sure nothing broke, e.g. (this will run py34/py27/pep8 tests):
.. code-block:: bash
@ -127,13 +127,41 @@ To run unit tests locally:
$ pip install tox
$ tox
To run py26, py27 or pep8 only:
To run py34, py27 or pep8 only:
.. code-block:: console
$ tox -e <name>
#NOTE: <name> is one of py26, py27 or pep8
#NOTE: <name> is one of py34, py27 or pep8
To run a single unit test e.g. test_deployment
.. code-block:: console
$ tox -e <name> -- <test_name>
#NOTE: <name> is one of py34, py27 or pep8
# <test_name> is the unit test case name
To debug issues on the unit test:
- Add breakpoints on the test file using ``import pdb;`` ``pdb.set_trace()``
- Then run tox in debug mode:
.. code-block:: console
$ tox -e debug <test_name>
#NOTE: use python 2.7
#NOTE: <test_name> is the unit test case name
or
.. code-block:: console
$ tox -e debug34 <test_name>
#NOTE: use python 3.4
#NOTE: <test_name> is the unit test case name
To get test coverage:

View File

@ -35,10 +35,19 @@ basepython = python3.4
[testenv:venv]
commands = {posargs}
[testenv:debug]
commands = oslo_debug_helper -t tests {posargs}
[testenv:debug34]
basepython = python3.4
commands = oslo_debug_helper -t tests {posargs}
[testenv:cli]
sitepackages = True
commands = {toxinidir}/tests/ci/rally-integrated.sh
[testenv:cover]
commands = {toxinidir}/tests/ci/cover.sh {posargs}