From 31303ed65e400c6df7d71e03ba030a1bada17118 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Fri, 24 Sep 2021 17:31:36 +0100 Subject: [PATCH] docs: Add whereto for testing redirect rules Use whereto to test that the redirect rules do what we expect. This has been used in nova-land for years and is helpful as things move around. Change-Id: I4697c4ce53eb8d67d2f7593085e3eb88f239d1dd Signed-off-by: Stephen Finucane --- doc/requirements.txt | 3 +++ doc/test/redirect-tests.txt | 1 + tox.ini | 8 ++++---- 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 doc/test/redirect-tests.txt diff --git a/doc/requirements.txt b/doc/requirements.txt index 1e152cfdc70..6598ecf1160 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -8,3 +8,6 @@ Pygments>=2.6.1 # BSD license os-api-ref>=2.1.0 # Apache-2.0 sphinxcontrib-apidoc>=0.3.0 # BSD sphinx-feature-classification>=1.1.0 # Apache 2.0 + +# redirect tests in docs +whereto>=0.4.0 # Apache-2.0 diff --git a/doc/test/redirect-tests.txt b/doc/test/redirect-tests.txt new file mode 100644 index 00000000000..9bceffa0a04 --- /dev/null +++ b/doc/test/redirect-tests.txt @@ -0,0 +1 @@ +/cinder/latest/man/cinder-manage.html 301 /cinder/latest/cli/cinder-manage.html diff --git a/tox.ini b/tox.ini index 291756f5e30..1945856eab7 100644 --- a/tox.ini +++ b/tox.ini @@ -114,7 +114,6 @@ sitepackages = False envdir = {toxworkdir}/pep8 commands = oslo-config-generator --config-file=tools/config/cinder-config-generator.conf - [testenv:genpolicy] commands = oslopolicy-sample-generator --config-file=tools/config/cinder-policy-generator.conf @@ -127,13 +126,14 @@ commands = python tools/config/generate_cinder_opts.py commands = {posargs} [testenv:docs] +allowlist_externals = rm deps = -r{toxinidir}/doc/requirements.txt commands = - rm -fr doc/source/contributor/api/ - rm -fr doc/build/html doc/build/doctrees + rm -rf doc/source/contributor/api doc/build/html doc/build/doctrees sphinx-build -W -j auto -b html -d doc/build/doctrees doc/source doc/build/html -allowlist_externals = rm + # Test the redirects. This must run after the main docs build + whereto doc/build/html/.htaccess doc/test/redirect-tests.txt [testenv:pdf-docs] deps = {[testenv:docs]deps}