[master 1/1] Include automatic and manual test documentation.

atodorov installerbot-noreply at redhat.com
Wed May 27 07:57:05 UTC 2015


From: Alexander Todorov <atodorov at redhat.com>

---
 .gitignore       |  1 +
 doc/Makefile     |  5 +++++
 doc/conf.py      |  6 +++++-
 doc/index.rst    |  2 ++
 doc/testing.rst  |  1 +
 tests/README.rst | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 66 insertions(+), 1 deletion(-)
 create mode 100644 doc/testing.rst
 create mode 100644 tests/README.rst

diff --git a/.gitignore b/.gitignore
index 54c7439..5966691 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@ doc/blivet.devicelibs.rst
 doc/blivet.formats.rst
 doc/blivet.rst
 doc/modules.rst
+doc/tests*.rst
 doc/_build
 po/*.gmo
 po/*.po
diff --git a/doc/Makefile b/doc/Makefile
index 2fc38ee..691aef6 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -43,11 +43,16 @@ help:
 
 clean:
 	-rm -rf $(BUILDDIR)/*
+	-rm -f $(addprefix ./, tests.*)
 
 apidoc:
+	-rm -f $(addprefix ./, tests.* modules.rst)
+	$(SPHINXAPIDOC) -o . ../tests/
+	-cp modules.rst tests.modules.rst
 	-rm $(addprefix ./, $(MODULE_NAMES))
 	$(SPHINXAPIDOC) -o . $(SOURCEDIR)
 
+
 html: apidoc
 	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
 	@echo
diff --git a/doc/conf.py b/doc/conf.py
index 88d0f7c..50d2b9c 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -25,7 +25,11 @@
 
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage']
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', \
+                'sphinx.ext.coverage', 'sphinx.ext.inheritance_diagram', 'sphinx.ext.graphviz'
+            ]
+
+inheritance_graph_attrs = dict(rankdir="LR", size='""')
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
diff --git a/doc/index.rst b/doc/index.rst
index 5c32438..9accf3c 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -13,6 +13,8 @@ Contents:
 
    intro
    modules
+   testing
+   tests.modules
 
 Indices and tables
 ==================
diff --git a/doc/testing.rst b/doc/testing.rst
new file mode 100644
index 0000000..7e7bbfc
--- /dev/null
+++ b/doc/testing.rst
@@ -0,0 +1 @@
+.. include:: ../tests/README.rst
diff --git a/tests/README.rst b/tests/README.rst
new file mode 100644
index 0000000..8f22c6b
--- /dev/null
+++ b/tests/README.rst
@@ -0,0 +1,52 @@
+Testing Blivet
+==============
+
+Note: The test suite documented here is available only from the git repository
+not as part of any installable packages.
+
+In order to execute blivet's test suite from inside the source directory execute
+the command::
+
+    make test
+
+Some tests require root access on the system and will be skipped if you're
+running as non-root user.
+
+To execute the Pylint code analysis tool run::
+
+    make check
+
+Running Pylint doesn't require root privileges.
+
+It is also possible to generate test coverage reports using the Python coverage
+tool. To do that execute::
+
+    make coverage
+
+It is also possible to check all external links in the documentation for
+integrity. To do this::
+
+    cd doc/
+    make linkcheck
+
+Test Suite Architecture
+------------------------
+
+Blivet's test suite relies on the base classes shown below. These classes
+take care of working with fake block or loop devices.
+
+.. inheritance-diagram::
+    tests.imagebackedtestcase
+    tests.loopbackedtestcase
+    tests.storagetestcase
+    tests.devicetree_test.BlivetResetTestCase
+
+Actual test cases inherit either :class:`unittest.TestCase` or one of
+these base classes. Some use cases require more levels of abstraction
+which is shown on the following diagram.
+
+.. inheritance-diagram::
+    tests.devicetree_test
+    tests.formats_test.fs_test
+    tests.formats_test.fslabeling
+


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/365c80472c6fdb21a004e47ec556797e80764dd1


More information about the anaconda-patches mailing list