Clean up and clarify tox.ini
While looking into making py36 available when running tox without '-e' and making py37 more available for both unit testing and functional testing, it became clear that our tox.ini was a bit messy. This change cleans it up to: * Removes all py* jobs and lets tox define those automatically. Their commands come from the base [testenv]. Non-unit tests need to define their commands specifically. * move pep-related tox below both unit and functional * remove some out of date comments * set the default when using tox without -e to unit and functional in 2.7 and 3.6, and pep8 * removes the 'stestr slowest' from the unit and functional test env's. It's not used consistently and the output is far from consistent so it doesn't seem to have any particular value (for this project) This is one of several ways to do this cleanup. This way assumes some knowledge of the fact that tox defines a lot default jobs with default python versions (via factors[1]). Note that the releasenotes job does not currently work and did not work before these changes, a conf.py is missing. [1] https://tox.readthedocs.io/en/latest/config.html#factors-and-factor-conditional-settings Change-Id: I9a877439e13eb753c7f98dc02e41db891ce33690
This commit is contained in:
parent
5d8aa50074
commit
3b569321cc
83
tox.ini
83
tox.ini
@ -1,10 +1,9 @@
|
||||
[tox]
|
||||
minversion = 2.1
|
||||
envlist = py{27,35},functional,pep8
|
||||
envlist = py{27,36},functional,functional-py36,pep8
|
||||
skipsdist = True
|
||||
|
||||
[testenv]
|
||||
basepython = python3
|
||||
usedevelop = True
|
||||
whitelist_externals =
|
||||
bash
|
||||
@ -22,35 +21,42 @@ setenv =
|
||||
# TODO(stephenfin): Remove psycopg2 when minimum constraints is bumped to 2.8
|
||||
PYTHONWARNINGS = ignore::UserWarning:psycopg2
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
# For a venv that doesn't use stestr commands must be overridden.
|
||||
commands =
|
||||
find . -type f -name "*.pyc" -delete
|
||||
stestr run {posargs}
|
||||
passenv =
|
||||
OS_DEBUG GENERATE_HASHES
|
||||
# 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.
|
||||
|
||||
[testenv:py27]
|
||||
# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed.
|
||||
# The functional environment is both the base env for functional tests and
|
||||
# also the python 2.7 version of functional tests. This is a historical
|
||||
# artifact.
|
||||
[testenv:functional]
|
||||
basepython = python2.7
|
||||
envdir = {toxworkdir}/py27
|
||||
commands =
|
||||
{[testenv]commands}
|
||||
stestr run {posargs}
|
||||
stestr slowest
|
||||
find . -type f -name "*.pyc" -delete
|
||||
stestr --test-path=./placement/tests/functional run {posargs}
|
||||
|
||||
[testenv:py35]
|
||||
# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed.
|
||||
basepython = python3.5
|
||||
[testenv:functional-py35]
|
||||
envdir = {toxworkdir}/py35
|
||||
commands =
|
||||
{[testenv]commands}
|
||||
stestr run {posargs}
|
||||
{[testenv:functional]commands}
|
||||
|
||||
[testenv:py36]
|
||||
# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed.
|
||||
basepython = python3.6
|
||||
[testenv:functional-py36]
|
||||
envdir = {toxworkdir}/py36
|
||||
commands =
|
||||
{[testenv:py35]commands}
|
||||
{[testenv:functional]commands}
|
||||
|
||||
[testenv:functional-py37]
|
||||
envdir = {toxworkdir}/py37
|
||||
commands =
|
||||
{[testenv:functional]commands}
|
||||
|
||||
[testenv:pep8]
|
||||
basepython = python3
|
||||
description =
|
||||
Run style checks.
|
||||
envdir = {toxworkdir}/shared
|
||||
@ -58,45 +64,21 @@ commands =
|
||||
bash tools/flake8wrap.sh {posargs}
|
||||
|
||||
[testenv:fast8]
|
||||
basepython = python3
|
||||
description =
|
||||
Run style checks on the changes made since HEAD~. For a full run including docs, use 'pep8'
|
||||
envdir = {toxworkdir}/shared
|
||||
commands =
|
||||
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]
|
||||
basepython = python3
|
||||
envdir = {toxworkdir}/shared
|
||||
commands =
|
||||
oslo-config-generator --config-file=etc/placement/config-generator.conf
|
||||
|
||||
[testenv:genpolicy]
|
||||
basepython = python3
|
||||
envdir = {toxworkdir}/shared
|
||||
commands =
|
||||
oslopolicy-sample-generator --config-file=etc/placement/policy-generator.conf
|
||||
@ -106,12 +88,13 @@ commands =
|
||||
# section once we rely on coverage 4.3+
|
||||
#
|
||||
# https://bitbucket.org/ned/coveragepy/issues/519/
|
||||
basepython = python3
|
||||
envdir = {toxworkdir}/shared
|
||||
setenv =
|
||||
{[testenv]setenv}
|
||||
PYTHON=coverage run --source placement --parallel-mode
|
||||
commands =
|
||||
{[testenv]commands}
|
||||
find . -type f -name "*.pyc" -delete
|
||||
coverage erase
|
||||
stestr --test-path=./placement/tests run {posargs}
|
||||
coverage combine
|
||||
@ -120,12 +103,14 @@ commands =
|
||||
coverage report
|
||||
|
||||
[testenv:debug]
|
||||
basepython = python3
|
||||
envdir = {toxworkdir}/shared
|
||||
commands =
|
||||
{[testenv]commands}
|
||||
find . -type f -name "*.pyc" -delete
|
||||
oslo_debug_helper {posargs}
|
||||
|
||||
[testenv:venv]
|
||||
basepython = python3
|
||||
deps =
|
||||
-r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
@ -134,6 +119,7 @@ commands =
|
||||
{posargs}
|
||||
|
||||
[testenv:docs]
|
||||
basepython = python3
|
||||
description =
|
||||
Build all documentation including API guides and refs.
|
||||
deps = -r{toxinidir}/doc/requirements.txt
|
||||
@ -143,6 +129,7 @@ commands =
|
||||
{[testenv:api-ref]commands}
|
||||
|
||||
[testenv:api-ref]
|
||||
basepython = python3
|
||||
description =
|
||||
Generate the API ref. Called from CI scripts to test and publish to developer.openstack.org.
|
||||
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
|
||||
|
||||
[testenv:releasenotes]
|
||||
basepython = python3
|
||||
description =
|
||||
Generate release notes.
|
||||
envdir = {toxworkdir}/docs
|
||||
@ -163,6 +151,7 @@ commands =
|
||||
[testenv:bandit]
|
||||
# NOTE(browne): This is required for the integration test job of the bandit
|
||||
# project. Please do not remove.
|
||||
basepython = python3
|
||||
envdir = {toxworkdir}/shared
|
||||
commands = bandit -r placement -x tests -n 5 -ll
|
||||
|
||||
@ -204,10 +193,8 @@ commands =
|
||||
bindep test
|
||||
|
||||
[testenv:lower-constraints]
|
||||
basepython = python3
|
||||
deps =
|
||||
-c{toxinidir}/lower-constraints.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
-r{toxinidir}/requirements.txt
|
||||
commands =
|
||||
{[testenv]commands}
|
||||
stestr run {posargs}
|
||||
|
Loading…
x
Reference in New Issue
Block a user