Skip to content

Commit 7e4ef4c

Browse files
committed
Add PDF building
This commit add PDF building tox.ini environment and options for LaTeX output. overview.rst is copied from README.rst. And, the original README.rst file is shrunk because we don't need such a long information in the README file. People can see the same contents in overview.rst now. Change-Id: Id654c814988e78704726d2ba8bea9a03ce8596f8
1 parent 9e63a03 commit 7e4ef4c

File tree

6 files changed

+323
-271
lines changed

6 files changed

+323
-271
lines changed

README.rst

Lines changed: 6 additions & 265 deletions
Original file line numberDiff line numberDiff line change
@@ -10,274 +10,15 @@ Team and repository tags
1010
Tempest - The OpenStack Integration Test Suite
1111
==============================================
1212

13-
The documentation for Tempest is officially hosted at:
14-
https://docs.openstack.org/tempest/latest/
15-
1613
This is a set of integration tests to be run against a live OpenStack
1714
cluster. Tempest has batteries of tests for OpenStack API validation,
1815
scenarios, and other specific tests useful in validating an OpenStack
1916
deployment.
2017

21-
Design Principles
22-
-----------------
23-
Tempest Design Principles that we strive to live by.
24-
25-
- Tempest should be able to run against any OpenStack cloud, be it a
26-
one node DevStack install, a 20 node LXC cloud, or a 1000 node KVM
27-
cloud.
28-
- Tempest should be explicit in testing features. It is easy to auto
29-
discover features of a cloud incorrectly, and give people an
30-
incorrect assessment of their cloud. Explicit is always better.
31-
- Tempest uses OpenStack public interfaces. Tests in Tempest should
32-
only touch public OpenStack APIs.
33-
- Tempest should not touch private or implementation specific
34-
interfaces. This means not directly going to the database, not
35-
directly hitting the hypervisors, not testing extensions not
36-
included in the OpenStack base. If there are some features of
37-
OpenStack that are not verifiable through standard interfaces, this
38-
should be considered a possible enhancement.
39-
- Tempest strives for complete coverage of the OpenStack API and
40-
common scenarios that demonstrate a working cloud.
41-
- Tempest drives load in an OpenStack cloud. By including a broad
42-
array of API and scenario tests Tempest can be reused in whole or in
43-
parts as load generation for an OpenStack cloud.
44-
- Tempest should attempt to clean up after itself, whenever possible
45-
we should tear down resources when done.
46-
- Tempest should be self-testing.
47-
48-
Quickstart
49-
----------
50-
51-
To run Tempest, you first need to create a configuration file that will tell
52-
Tempest where to find the various OpenStack services and other testing behavior
53-
switches. Where the configuration file lives and how you interact with it
54-
depends on how you'll be running Tempest. There are 2 methods of using Tempest.
55-
The first, which is a newer and recommended workflow treats Tempest as a system
56-
installed program. The second older method is to run Tempest assuming your
57-
working dir is the actually Tempest source repo, and there are a number of
58-
assumptions related to that. For this section we'll only cover the newer method
59-
as it is simpler, and quicker to work with.
60-
61-
#. You first need to install Tempest. This is done with pip after you check out
62-
the Tempest repo::
63-
64-
$ git clone https://opendev.org/openstack/tempest
65-
$ pip install tempest/
66-
67-
This can be done within a venv, but the assumption for this guide is that
68-
the Tempest CLI entry point will be in your shell's PATH.
69-
70-
#. Installing Tempest may create a ``/etc/tempest dir``, however if one isn't
71-
created you can create one or use ``~/.tempest/etc`` or ``~/.config/tempest`` in
72-
place of ``/etc/tempest``. If none of these dirs are created Tempest will create
73-
``~/.tempest/etc`` when it's needed. The contents of this dir will always
74-
automatically be copied to all ``etc/`` dirs in local workspaces as an initial
75-
setup step. So if there is any common configuration you'd like to be shared
76-
between local Tempest workspaces it's recommended that you pre-populate it
77-
before running ``tempest init``.
78-
79-
#. Setup a local Tempest workspace. This is done by using the tempest init
80-
command::
81-
82-
$ tempest init cloud-01
83-
84-
which also works the same as::
85-
86-
$ mkdir cloud-01 && cd cloud-01 && tempest init
87-
88-
This will create a new directory for running a single Tempest configuration.
89-
If you'd like to run Tempest against multiple OpenStack deployments the idea
90-
is that you'll create a new working directory for each to maintain separate
91-
configuration files and local artifact storage for each.
92-
93-
#. Then ``cd`` into the newly created working dir and also modify the local
94-
config files located in the ``etc/`` subdir created by the ``tempest init``
95-
command. Tempest is expecting a ``tempest.conf`` file in etc/ so if only a
96-
sample exists you must rename or copy it to tempest.conf before making
97-
any changes to it otherwise Tempest will not know how to load it. For
98-
details on configuring Tempest refer to the
99-
`Tempest Configuration <https://docs.openstack.org/tempest/latest/configuration.html#tempest-configuration>`_
100-
101-
#. Once the configuration is done you're now ready to run Tempest. This can
102-
be done using the `Tempest Run <https://docs.openstack.org/tempest/latest/run.html#tempest-run>`_
103-
command. This can be done by either
104-
running::
105-
106-
$ tempest run
107-
108-
from the Tempest workspace directory. Or you can use the ``--workspace``
109-
argument to run in the workspace you created regardless of your current
110-
working directory. For example::
111-
112-
$ tempest run --workspace cloud-01
113-
114-
There is also the option to use `stestr`_ directly. For example, from
115-
the workspace dir run::
116-
117-
$ stestr run --black-regex '\[.*\bslow\b.*\]' '^tempest\.(api|scenario)'
118-
119-
will run the same set of tests as the default gate jobs. Or you can
120-
use `unittest`_ compatible test runners such as `testr`_, `pytest`_ etc.
121-
122-
Tox also contains several existing job configurations. For example::
123-
124-
$ tox -e full
125-
126-
which will run the same set of tests as the OpenStack gate. (it's exactly how
127-
the gate invokes Tempest) Or::
128-
129-
$ tox -e smoke
130-
131-
to run the tests tagged as smoke.
132-
133-
.. _unittest: https://docs.python.org/3/library/unittest.html
134-
.. _testr: https://testrepository.readthedocs.org/en/latest/MANUAL.html
135-
.. _stestr: https://stestr.readthedocs.org/en/latest/MANUAL.html
136-
.. _pytest: https://docs.pytest.org/en/latest/
137-
138-
Library
139-
-------
140-
Tempest exposes a library interface. This interface is a stable interface and
141-
should be backwards compatible (including backwards compatibility with the
142-
old tempest-lib package, with the exception of the import). If you plan to
143-
directly consume Tempest in your project you should only import code from the
144-
Tempest library interface, other pieces of Tempest do not have the same
145-
stable interface and there are no guarantees on the Python API unless otherwise
146-
stated.
147-
148-
For more details refer to the `library documentation
149-
<https://docs.openstack.org/tempest/latest/library.html#library>`_
150-
151-
Release Versioning
152-
------------------
153-
`Tempest Release Notes <https://docs.openstack.org/releasenotes/tempest>`_
154-
shows what changes have been released on each version.
155-
156-
Tempest's released versions are broken into 2 sets of information. Depending on
157-
how you intend to consume Tempest you might need
158-
159-
The version is a set of 3 numbers:
160-
161-
X.Y.Z
162-
163-
While this is almost `semver`_ like, the way versioning is handled is slightly
164-
different:
165-
166-
X is used to represent the supported OpenStack releases for Tempest tests
167-
in-tree, and to signify major feature changes to Tempest. It's a monotonically
168-
increasing integer where each version either indicates a new supported OpenStack
169-
release, the drop of support for an OpenStack release (which will coincide with
170-
the upstream stable branch going EOL), or a major feature lands (or is removed)
171-
from Tempest.
172-
173-
Y.Z is used to represent library interface changes. This is treated the same
174-
way as minor and patch versions from `semver`_ but only for the library
175-
interface. When Y is incremented we've added functionality to the library
176-
interface and when Z is incremented it's a bug fix release for the library.
177-
Also note that both Y and Z are reset to 0 at each increment of X.
178-
179-
.. _semver: https://semver.org/
180-
181-
Configuration
182-
-------------
183-
184-
Detailed configuration of Tempest is beyond the scope of this
185-
document, see `Tempest Configuration Documentation
186-
<https://docs.openstack.org/tempest/latest/configuration.html#tempest-configuration>`_
187-
for more details on configuring Tempest.
188-
The ``etc/tempest.conf.sample`` attempts to be a self-documenting
189-
version of the configuration.
190-
191-
You can generate a new sample tempest.conf file, run the following
192-
command from the top level of the Tempest directory::
193-
194-
$ tox -e genconfig
195-
196-
The most important pieces that are needed are the user ids, OpenStack
197-
endpoints, and basic flavors and images needed to run tests.
198-
199-
Unit Tests
200-
----------
201-
202-
Tempest also has a set of unit tests which test the Tempest code itself. These
203-
tests can be run by specifying the test discovery path::
204-
205-
$ stestr --test-path ./tempest/tests run
206-
207-
By setting ``--test-path`` option to ./tempest/tests it specifies that test discover
208-
should only be run on the unit test directory. The default value of ``test_path``
209-
is ``test_path=./tempest/test_discover`` which will only run test discover on the
210-
Tempest suite.
211-
212-
Alternatively, there are the py27 and py36 tox jobs which will run the unit
213-
tests with the corresponding version of python.
214-
215-
One common activity is to just run a single test, you can do this with tox
216-
simply by specifying to just run py27 or py36 tests against a single test::
217-
218-
$ tox -e py36 -- -n tempest.tests.test_microversions.TestMicroversionsTestsClass.test_config_version_none_23
219-
220-
Or all tests in the test_microversions.py file::
221-
222-
$ tox -e py36 -- -n tempest.tests.test_microversions
223-
224-
You may also use regular expressions to run any matching tests::
225-
226-
$ tox -e py36 -- test_microversions
227-
228-
Additionally, when running a single test, or test-file, the ``-n/--no-discover``
229-
argument is no longer required, however it may perform faster if included.
230-
231-
For more information on these options and details about stestr, please see the
232-
`stestr documentation <https://stestr.readthedocs.io/en/latest/MANUAL.html>`_.
233-
234-
Python 3.x
235-
----------
236-
237-
Starting during the Pike cycle Tempest has a gating CI job that runs Tempest
238-
with Python 3. Any Tempest release after 15.0.0 should fully support running
239-
under Python 3 as well as Python 2.7.
240-
241-
Legacy run method
242-
-----------------
243-
244-
The legacy method of running Tempest is to just treat the Tempest source code
245-
as a python unittest repository and run directly from the source repo. When
246-
running in this way you still start with a Tempest config file and the steps
247-
are basically the same except that it expects you know where the Tempest code
248-
lives on your system and requires a bit more manual interaction to get Tempest
249-
running. For example, when running Tempest this way things like a lock file
250-
directory do not get generated automatically and the burden is on the user to
251-
create and configure that.
252-
253-
To start you need to create a configuration file. The easiest way to create a
254-
configuration file is to generate a sample in the ``etc/`` directory ::
255-
256-
$ cd $TEMPEST_ROOT_DIR
257-
$ oslo-config-generator --config-file \
258-
tempest/cmd/config-generator.tempest.conf \
259-
--output-file etc/tempest.conf
260-
261-
After that, open up the ``etc/tempest.conf`` file and edit the
262-
configuration variables to match valid data in your environment.
263-
This includes your Keystone endpoint, a valid user and credentials,
264-
and reference data to be used in testing.
265-
266-
.. note::
267-
268-
If you have a running DevStack environment, Tempest will be
269-
automatically configured and placed in ``/opt/stack/tempest``. It
270-
will have a configuration file already set up to work with your
271-
DevStack installation.
272-
273-
Tempest is not tied to any single test runner, but `testr`_ is the most commonly
274-
used tool. Also, the nosetests test runner is **not** recommended to run Tempest.
275-
276-
After setting up your configuration file, you can execute the set of Tempest
277-
tests by using ``testr`` ::
278-
279-
$ testr run --parallel
280-
281-
To run one single test serially ::
18+
* Documentation: https://docs.openstack.org/tempest/latest/
19+
* Features: https://specs.openstack.org/openstack/qa-specs/#tempest
20+
* Bugs: https://bugs.launchpad.net/tempest/
21+
* Release Notes: https://docs.openstack.org/releasenotes/tempest
28222

283-
$ testr run tempest.api.compute.servers.test_servers_negative.ServersNegativeTestJSON.test_reboot_non_existent_server
23+
Get in touch via `email <mailto:[email protected]>`_. Use
24+
[tempest] in your subject.

doc/requirements.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# The order of packages is significant, because pip processes them in the order
22
# of appearance. Changing the order has an impact on the overall integration
33
# process, which may cause wedges in the gate later.
4-
openstackdocstheme>=1.18.1 # Apache-2.0
4+
openstackdocstheme>=1.20.0 # Apache-2.0
55
reno>=2.5.0 # Apache-2.0
6-
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
6+
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
7+
sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2;python_version>='3.4' # BSD
8+
sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD

doc/source/conf.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def setup(app):
5252
extensions = ['sphinx.ext.autodoc',
5353
'sphinx.ext.todo',
5454
'sphinx.ext.viewcode',
55+
'sphinxcontrib.rsvgconverter',
5556
'openstackdocstheme',
5657
'oslo_config.sphinxconfiggen',
5758
]
@@ -196,3 +197,16 @@ def setup(app):
196197

197198
# A list of warning types to suppress arbitrary warning messages.
198199
suppress_warnings = ['image.nonlocal_uri']
200+
201+
# -- Options for LaTeX output -------------------------------------------------
202+
203+
# Grouping the document tree into LaTeX files. List of tuples
204+
# (source start file, target name, title, author, documentclass
205+
# [howto/manual]).
206+
latex_documents = [
207+
('index', 'doc-tempest.tex', u'Tempest Testing Project',
208+
u'OpenStack Foundation', 'manual'),
209+
]
210+
211+
# Disable usage of xindy https://bugzilla.redhat.com/show_bug.cgi?id=1643664
212+
latex_use_xindy = False

doc/source/index.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ Support Policy
8888

8989
stable_branch_support_policy
9090

91-
Indices and tables
92-
==================
91+
Search
92+
======
9393

94-
* :ref:`search`
94+
.. only:: html
95+
96+
* :ref:`Tempest document search <search>`: Search the contents of this document.
97+
98+
* `OpenStack wide search <https://docs.openstack.org>`_: Search the wider
99+
set of OpenStack documentation, including forums.

doc/source/overview.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)