Turn on docs warning check in document generation

Use -W (turn warnings into errors) option of sphinx-build
in the commandline of 'docs' tox target so that developer
can easily check sphinx warning.

Also runs the same documentation check in 'pep8' tox target
to detect sphinx warning in the gate.
The current 'docs' job in the gate does not use 'tox -edocs'
intentionally and calls build_sphinx via 'tox -evenv' [1],
so sphinx warnings are not detected in the 'docs' job.

Note that we no longer generate the whole code reference so this
change does not increase the time of 'tox -epep8' much,
while we can prevent new sphinx warnings.

[1] 6b50d7e3a6/jenkins/scripts/run-docs.sh (L16-L19)

Closes-Bug: #1411719
Closes-Bug: #1486222
Change-Id: Idc6e8a1c5762eba113b2d110d5fa223ab7406be3
This commit is contained in:
Akihiro Motoki 2016-09-21 07:08:28 +09:00
parent 215ccba9ec
commit f880f6c723

View File

@ -61,6 +61,7 @@ setenv =
DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings
commands = commands =
{[testenv:extractmessages_check]commands} {[testenv:extractmessages_check]commands}
{[testenv:docs]commands}
flake8 flake8
[testenv:extractmessages] [testenv:extractmessages]
@ -136,7 +137,7 @@ commands =
[testenv:docs] [testenv:docs]
setenv = DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings setenv = DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings
commands = {envpython} {toxinidir}/setup.py build_sphinx commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:releasenotes] [testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html