clean up test job configuration

Make the py27 and py35 jobs run the same commands by putting them into
the base testenv block.

Move the doc8 job into the pep8 environment to run with the other
linters.

Change the way we invoke sphinx to run the doctests to avoid issues
with pbr's sphinx integration. This also required removing skipdist
and usedevelop to ensure that all of the pbr-generated files needed by
sphinx exist before we run sphinx.

Change the way sphinx is invoked in the docs environment to avoid
issues with pbr's sphinx integration.

Change-Id: If8a24428eca4512a66dbb361e55cd73aa92c4da8
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-04-13 15:57:30 -04:00
parent 481ee13445
commit 936a5d5f13
1 changed files with 10 additions and 11 deletions

21
tox.ini
View File

@ -1,11 +1,9 @@
[tox] [tox]
minversion = 2.0 minversion = 2.0
envlist = py35,py27,pypy,pep8 envlist = py35,py27,pypy,pep8
skipsdist = True
[testenv] [testenv]
basepython = python3 basepython = python3
usedevelop = True
install_command = pip install {opts} {packages} install_command = pip install {opts} {packages}
whitelist_externals = find whitelist_externals = find
rm rm
@ -13,31 +11,32 @@ deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
commands = python setup.py test --slowest --testr-args='{posargs}' commands =
python setup.py testr --slowest --testr-args='{posargs}'
sphinx-build -E -W -b doctest doc/source doc/build/doctest
[testenv:pep8] [testenv:pep8]
commands = flake8 commands =
flake8
doc8 doc/source
[testenv:venv] [testenv:venv]
commands = {posargs} commands = {posargs}
[testenv:cover] [testenv:cover]
commands = commands =
coverage erase coverage erase
find . -type f -name "*.pyc" -delete find . -type f -name "*.pyc" -delete
python setup.py test --coverage --testr-args='{posargs}' python setup.py test --coverage --testr-args='{posargs}'
coverage report coverage report
[testenv:py27] [testenv:py27]
commands =
python setup.py testr --slowest --testr-args='{posargs}'
python setup.py build_sphinx -b doctest
doc8 doc/source
basepython = python2.7 basepython = python2.7
[testenv:docs] [testenv:docs]
commands = rm -rf doc/build commands =
python setup.py build_sphinx rm -rf doc/build
sphinx-build -E -W -b html doc/source doc/build/html
[testenv:debug] [testenv:debug]
commands = oslo_debug_helper {posargs} commands = oslo_debug_helper {posargs}