Merge "Clean up and clarify tox.ini"

This commit is contained in:
Zuul 2018-11-27 16:14:21 +00:00 committed by Gerrit Code Review
commit fbc459e07d

83
tox.ini
View File

@ -1,10 +1,9 @@
[tox] [tox]
minversion = 2.1 minversion = 2.1
envlist = py{27,35},functional,pep8 envlist = py{27,36},functional,functional-py36,pep8
skipsdist = True skipsdist = True
[testenv] [testenv]
basepython = python3
usedevelop = True usedevelop = True
whitelist_externals = whitelist_externals =
bash bash
@ -22,35 +21,42 @@ setenv =
# TODO(stephenfin): Remove psycopg2 when minimum constraints is bumped to 2.8 # TODO(stephenfin): Remove psycopg2 when minimum constraints is bumped to 2.8
PYTHONWARNINGS = ignore::UserWarning:psycopg2 PYTHONWARNINGS = ignore::UserWarning:psycopg2
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
# For a venv that doesn't use stestr commands must be overridden.
commands = commands =
find . -type f -name "*.pyc" -delete find . -type f -name "*.pyc" -delete
stestr run {posargs}
passenv = passenv =
OS_DEBUG GENERATE_HASHES OS_DEBUG GENERATE_HASHES
# there is also secret magic in subunit-trace which lets you run in a fail only # there is also secret magic in subunit-trace which lets you run in a fail only
# mode. To do this define the TRACE_FAILONLY environmental variable. # mode. To do this define the TRACE_FAILONLY environmental variable.
[testenv:py27] # The functional environment is both the base env for functional tests and
# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed. # also the python 2.7 version of functional tests. This is a historical
# artifact.
[testenv:functional]
basepython = python2.7 basepython = python2.7
envdir = {toxworkdir}/py27
commands = commands =
{[testenv]commands} find . -type f -name "*.pyc" -delete
stestr run {posargs} stestr --test-path=./placement/tests/functional run {posargs}
stestr slowest
[testenv:py35] [testenv:functional-py35]
# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed. envdir = {toxworkdir}/py35
basepython = python3.5
commands = commands =
{[testenv]commands} {[testenv:functional]commands}
stestr run {posargs}
[testenv:py36] [testenv:functional-py36]
# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed. envdir = {toxworkdir}/py36
basepython = python3.6
commands = commands =
{[testenv:py35]commands} {[testenv:functional]commands}
[testenv:functional-py37]
envdir = {toxworkdir}/py37
commands =
{[testenv:functional]commands}
[testenv:pep8] [testenv:pep8]
basepython = python3
description = description =
Run style checks. Run style checks.
envdir = {toxworkdir}/shared envdir = {toxworkdir}/shared
@ -58,45 +64,21 @@ commands =
bash tools/flake8wrap.sh {posargs} bash tools/flake8wrap.sh {posargs}
[testenv:fast8] [testenv:fast8]
basepython = python3
description = description =
Run style checks on the changes made since HEAD~. For a full run including docs, use 'pep8' Run style checks on the changes made since HEAD~. For a full run including docs, use 'pep8'
envdir = {toxworkdir}/shared envdir = {toxworkdir}/shared
commands = commands =
bash tools/flake8wrap.sh -HEAD bash tools/flake8wrap.sh -HEAD
[testenv:functional]
# TODO(melwitt): This can be removed when functional tests are gating with
# python 3.x
basepython = python2.7
envdir = {toxworkdir}/py27
setenv = {[testenv]setenv}
commands =
{[testenv]commands}
stestr --test-path=./placement/tests/functional run {posargs}
stestr slowest
# TODO(gcb) Merge this into [testenv:functional] when functional tests are gating
# with python 3.5
[testenv:functional-py35]
basepython = python3.5
envdir = {toxworkdir}/py35
setenv = {[testenv]setenv}
commands =
{[testenv:functional]commands}
[testenv:functional-py36]
basepython = python3.6
envdir = {toxworkdir}/py36
setenv = {[testenv]setenv}
commands =
{[testenv:functional]commands}
[testenv:genconfig] [testenv:genconfig]
basepython = python3
envdir = {toxworkdir}/shared envdir = {toxworkdir}/shared
commands = commands =
oslo-config-generator --config-file=etc/placement/config-generator.conf oslo-config-generator --config-file=etc/placement/config-generator.conf
[testenv:genpolicy] [testenv:genpolicy]
basepython = python3
envdir = {toxworkdir}/shared envdir = {toxworkdir}/shared
commands = commands =
oslopolicy-sample-generator --config-file=etc/placement/policy-generator.conf oslopolicy-sample-generator --config-file=etc/placement/policy-generator.conf
@ -106,12 +88,13 @@ commands =
# section once we rely on coverage 4.3+ # section once we rely on coverage 4.3+
# #
# https://bitbucket.org/ned/coveragepy/issues/519/ # https://bitbucket.org/ned/coveragepy/issues/519/
basepython = python3
envdir = {toxworkdir}/shared envdir = {toxworkdir}/shared
setenv = setenv =
{[testenv]setenv} {[testenv]setenv}
PYTHON=coverage run --source placement --parallel-mode PYTHON=coverage run --source placement --parallel-mode
commands = commands =
{[testenv]commands} find . -type f -name "*.pyc" -delete
coverage erase coverage erase
stestr --test-path=./placement/tests run {posargs} stestr --test-path=./placement/tests run {posargs}
coverage combine coverage combine
@ -120,12 +103,14 @@ commands =
coverage report coverage report
[testenv:debug] [testenv:debug]
basepython = python3
envdir = {toxworkdir}/shared envdir = {toxworkdir}/shared
commands = commands =
{[testenv]commands} find . -type f -name "*.pyc" -delete
oslo_debug_helper {posargs} oslo_debug_helper {posargs}
[testenv:venv] [testenv:venv]
basepython = python3
deps = deps =
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
@ -134,6 +119,7 @@ commands =
{posargs} {posargs}
[testenv:docs] [testenv:docs]
basepython = python3
description = description =
Build all documentation including API guides and refs. Build all documentation including API guides and refs.
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
@ -143,6 +129,7 @@ commands =
{[testenv:api-ref]commands} {[testenv:api-ref]commands}
[testenv:api-ref] [testenv:api-ref]
basepython = python3
description = description =
Generate the API ref. Called from CI scripts to test and publish to developer.openstack.org. Generate the API ref. Called from CI scripts to test and publish to developer.openstack.org.
envdir = {toxworkdir}/docs envdir = {toxworkdir}/docs
@ -152,6 +139,7 @@ commands =
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[testenv:releasenotes] [testenv:releasenotes]
basepython = python3
description = description =
Generate release notes. Generate release notes.
envdir = {toxworkdir}/docs envdir = {toxworkdir}/docs
@ -163,6 +151,7 @@ commands =
[testenv:bandit] [testenv:bandit]
# NOTE(browne): This is required for the integration test job of the bandit # NOTE(browne): This is required for the integration test job of the bandit
# project. Please do not remove. # project. Please do not remove.
basepython = python3
envdir = {toxworkdir}/shared envdir = {toxworkdir}/shared
commands = bandit -r placement -x tests -n 5 -ll commands = bandit -r placement -x tests -n 5 -ll
@ -204,10 +193,8 @@ commands =
bindep test bindep test
[testenv:lower-constraints] [testenv:lower-constraints]
basepython = python3
deps = deps =
-c{toxinidir}/lower-constraints.txt -c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
commands =
{[testenv]commands}
stestr run {posargs}