diff --git a/.gitignore b/.gitignore index ba57bce..d82d500 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,11 @@ target/ # NetBeans user-specific build actions nbactions.xml + +# Testenvironment +.tox/ + +# Editors +*~ +.*.swp +.bak diff --git a/README.rst b/README.rst index f18af0c..dbd86f4 100644 --- a/README.rst +++ b/README.rst @@ -42,6 +42,25 @@ The root of the generated HTML documentation is:: v2.0/target/docbkx/webhelp/openstack-network/index.html +Testing of changes and building of the manual +============================================= + +Install the python tox package and run ``tox`` from the top-level +directory to use the same tests that are done as part of our Jenkins +gating jobs. + +If you like to run individual tests, run: +* ``tox -e checkniceness`` - to run the niceness tests +* ``tox -e checksyntax`` - to run syntax checks +* ``tox -e checkdeletions`` - to check that no deleted files are referenced +* ``tox -e checkbuild`` - to actually build the manual + +tox will use the `openstack-doc-tools package +`_ for execution of +these tests. openstack-doc-tools has a requirement on maven for the +build check. + + Installing ========== Refer to http://docs.openstack.org to see where these documents are published diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..5090e85 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +openstack-doc-tools diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..f61e353 --- /dev/null +++ b/tox.ini @@ -0,0 +1,28 @@ +[tox] +minversion = 1.6 +envlist = checkniceness,checksyntax,checkdeletions,checkbuild +skipsdist = True + +[testenv] +setenv = + VIRTUAL_ENV={envdir} + LANG=en_US.UTF-8 + LANGUAGE=en_US:en + LC_ALL=C +deps = -r{toxinidir}/test-requirements.txt + +[testenv:venv] +commands = {posargs} + +[testenv:checkniceness] +commands = openstack-doc-test --api-site --check-niceness {posargs} + +[testenv:checksyntax] +commands = openstack-doc-test --api-site --check-syntax {posargs} + +[testenv:checkdeletions] +commands = openstack-doc-test --api-site --check-deletions {posargs} + +[testenv:checkbuild] +# ignore directory v1.0, it is not published +commands = openstack-doc-test --api-site --ignore-dir=v1.0 --check-build {posargs}