Skip to content

Commit a7cc5c8

Browse files
author
zhang.xiuhua
committed
Add Tox prerequisites and installation
Change-Id: I48f4c571d1f1ae26ac930d8abad0cfbcb826ae46
1 parent 5293bb1 commit a7cc5c8

1 file changed

Lines changed: 43 additions & 19 deletions

File tree

doc/source/developing.rst

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,40 @@ please refer to the `OpenStack IRC meetings`_ page.
1515
Testing
1616
-------
1717

18-
Using ``tox``
19-
=============
18+
Tox prerequisites and installation
19+
===================================
2020

21-
Before running tests, you should have ``tox`` installed and available in your
22-
environment:
21+
Install the prerequisites for Tox:
22+
23+
* On Ubuntu or Debian:
24+
25+
.. code-block:: bash
26+
27+
$ apt-get install gcc gettext python-dev libxml2-dev libxslt1-dev \
28+
zlib1g-dev
29+
30+
You may need to use pip install for some packages.
31+
32+
33+
* On RHEL or CentOS including Fefora:
34+
35+
.. code-block:: bash
36+
37+
$ yum install gcc python-devel libxml2-devel libxslt-devel
38+
39+
* On openSUSE or SUSE linux Enterprise:
40+
41+
.. code-block:: bash
42+
43+
$ zypper install gcc python-devel libxml2-devel libxslt-devel
44+
45+
Install python-tox:
2346

2447
.. code-block:: bash
2548
2649
$ pip install tox
2750
28-
To execute the full suite of tests maintained within OpenStackClient, run:
51+
To run the full suite of tests maintained within OpenStackClient.
2952

3053
.. code-block:: bash
3154
@@ -37,9 +60,9 @@ To execute the full suite of tests maintained within OpenStackClient, run:
3760
virtualenvs. You can later use the ``-r`` option with ``tox`` to rebuild
3861
your virtualenv in a similar manner.
3962

40-
To run tests for one or more specific test environments (for example, the most
41-
common configuration of Python 2.7 and PEP-8), list the environments with the
42-
``-e`` option, separated by spaces:
63+
64+
To run tests for one or more specific test environments(for example, the most common configuration of
65+
Python 2.7 and PEP-8), list the environments with the ``-e`` option, separated by spaces:
4366

4467
.. code-block:: bash
4568
@@ -53,7 +76,7 @@ Running functional tests
5376
OpenStackClient also maintains a set of functional tests that are optimally
5477
designed to be run against OpenStack's gate. Optionally, a developer may
5578
choose to run these tests against any OpenStack deployment, however depending
56-
on the services available, results will vary.
79+
on the services available, results vary.
5780

5881
To run the entire suite of functional tests:
5982

@@ -70,33 +93,34 @@ To run a specific functional test:
7093
Running with PDB
7194
================
7295

73-
Using PDB breakpoints with ``tox`` and ``testr`` normally doesn't work since
96+
Using PDB breakpoints with ``tox`` and ``testr`` normally does not work since
7497
the tests fail with a `BdbQuit` exception rather than stopping at the
7598
breakpoint.
7699

77100
To run with PDB breakpoints during testing, use the `debug` ``tox`` environment
78-
rather than ``py27``. Here's an example, passing the name of a test since
79-
you'll normally only want to run the test that hits your breakpoint:
101+
rather than ``py27``. For example, passing a test name since you will normally
102+
only want to run the test that hits your breakpoint:
80103

81104
.. code-block:: bash
82105
83106
$ tox -e debug opentackclient.tests.identity.v3.test_group
84107
85-
For reference, the `debug` ``tox`` environment implements the instructions
86-
here: https://wiki.openstack.org/wiki/Testr#Debugging_.28pdb.29_Tests
108+
For reference, the `debug`_ ``tox`` environment implements the instructions
109+
110+
.. _`debug`: https://wiki.openstack.org/wiki/Testr#Debugging_.28pdb.29_Tests
87111

88112

89113
Building the Documentation
90114
--------------------------
91115

92116
The documentation is generated with Sphinx using the ``tox`` command. To
93-
create HTML docs, run the following:
117+
create HTML docs, run the commands:
94118

95119
.. code-block:: bash
96120
97121
$ tox -e docs
98122
99-
The resultant HTML will be the ``doc/build/html`` directory.
123+
The resultant HTML will be in the ``doc/build/html`` directory.
100124

101125
Release Notes
102126
-------------
@@ -115,23 +139,23 @@ If any of the following applies to the patch, a release note is required:
115139
* Current behavior is changed
116140
* A security bug is fixed
117141

118-
Reno is used to generate release notes. Please read the docs for details. In summary, use
142+
Reno is used to generate release notes. Use the commands:
119143

120144
.. code-block:: bash
121145
122146
$ tox -e venv -- reno new <bug-,bp-,whatever>
123147
124148
Then edit the sample file that was created and push it with your change.
125149

126-
To see the results:
150+
To run the commands and see results:
127151

128152
.. code-block:: bash
129153
130154
$ git commit # Commit the change because reno scans git log.
131155
132156
$ tox -e releasenotes
133157
134-
Then look at the generated release notes files in releasenotes/build/html in your favorite browser.
158+
At last, look at the generated release notes files in ``releasenotes/build/html`` in your browser.
135159

136160
Testing new code
137161
----------------

0 commit comments

Comments
 (0)