Create documentation for tests
Generate documentation for each test from its docstring.
The sphinx-apidoc tool is used to generate the .rst
files necessary for the generation of the documentation.
When the documentation is being build only functions that
start with "test" are passed to the resulting documentation.
Change-Id: I1878f67e10df9bb1f8289beda8e59a56b5057fe4
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 2a3edf4..59a2f64 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -24,6 +24,7 @@
import os
import subprocess
+import sys
# Build the plugin registry
def build_plugin_registry(app):
@@ -31,16 +32,20 @@
os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
subprocess.call(['tools/generate-tempest-plugins-list.sh'], cwd=root_dir)
+def autodoc_skip_member_handler(app, what, name, obj, skip, options):
+ return skip or (what == "class" and not name.startswith("test"))
+
def setup(app):
+ app.connect('autodoc-skip-member', autodoc_skip_member_handler)
if os.getenv('GENERATE_TEMPEST_PLUGIN_LIST', 'true').lower() == 'true':
app.connect('builder-inited', build_plugin_registry)
-
-
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
+# sys.path.insert(0, os.path.abspath('.'))
+sys.path.insert(0, os.path.abspath('../../tempest'))
+sys.path.insert(0, os.path.abspath('../../tempest/api'))
# -- General configuration -----------------------------------------------------
@@ -204,3 +209,10 @@
('index', 'doc-tempest.tex', u'Tempest Testing Project',
u'OpenStack Foundation', 'manual'),
]
+
+latex_use_xindy = False
+
+latex_elements = {
+ 'maxlistdepth': 20,
+ 'printindex': '\\footnotesize\\raggedright\\printindex'
+}
diff --git a/doc/source/index.rst b/doc/source/index.rst
index d4dc166..66e68ea 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -56,6 +56,13 @@
supported_version
+Description of Tests
+--------------------
+.. toctree::
+ :maxdepth: 2
+
+ tests/modules
+
For Contributors
================
diff --git a/doc/source/tests/modules.rst b/doc/source/tests/modules.rst
new file mode 100644
index 0000000..026a7a5
--- /dev/null
+++ b/doc/source/tests/modules.rst
@@ -0,0 +1,21 @@
+Description of Tests
+====================
+
+OpenStack Services Integration Tests
+------------------------------------
+.. toctree::
+ :maxdepth: 2
+
+ scenario/modules
+
+OpenStack Services API Tests
+----------------------------
+.. toctree::
+ :maxdepth: 2
+
+ compute/modules
+ identity/modules
+ image/modules
+ network/modules
+ object_storage/modules
+ volume/modules