Browse Source

fix tox python3 overrides

We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: Id3804896efc11de24d5e13500cdce7571e6d3314
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
changes/73/572973/3
Doug Hellmann 3 years ago
parent
commit
5c89506181
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      tox.ini

+ 12
- 0
tox.ini View File

@ -23,14 +23,17 @@ commands = stestr run {posargs}
# mode. To do this define the TRACE_FAILONLY environmental variable.
[testenv:debug]
basepython = python3
commands = oslo_debug_helper -t neutron/tests {posargs}
[testenv:common]
basepython = python3
# Fake job to define environment variables shared between dsvm/non-dsvm jobs
setenv = OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:180}
commands = false
[testenv:dsvm]
basepython = python3
# Fake job to define environment variables shared between dsvm jobs
setenv = OS_SUDO_TESTING=1
OS_ROOTWRAP_CMD=sudo {envdir}/bin/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf
@ -75,6 +78,7 @@ commands =
stestr run {posargs}
[testenv:dsvm-fullstack]
basepython = python2.7
setenv = {[testenv]setenv}
{[testenv:common]setenv}
{[testenv:dsvm]setenv}
@ -97,6 +101,7 @@ commands =
{[testenv:dsvm-fullstack]commands}
[testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
@ -133,13 +138,16 @@ commands =
coverage xml -o cover/coverage.xml
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:linkcheck]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b linkcheck doc/source doc/build/linkcheck
@ -170,6 +178,7 @@ import_exceptions = neutron._i18n
local-check-factory = neutron.hacking.checks.factory
[testenv:bandit]
basepython = python3
# B104: Possible binding to all interfaces
# B111: Execute with run_as_root=True identified, possible security issue
# B311: Standard pseudo-random generators are not suitable for security/cryptographic purpose
@ -177,6 +186,7 @@ deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r neutron -x tests -n5 -s B104,B111,B311
[testenv:bashate]
basepython = python3
commands = bash -c "find {toxinidir} \
-not \( -type d -name .tox\* -prune \) \
-not \( -type d -name .venv\* -prune \) \
@ -189,11 +199,13 @@ commands = bash -c "find {toxinidir} \
-print0 | xargs -0 bashate -v -iE006 -eE005,E042,E043"
[testenv:genconfig]
basepython = python3
commands = {toxinidir}/tools/generate_config_file_samples.sh
# This environment can be used to quickly validate that all needed system
# packages required to successfully execute test targets are installed
[testenv:bindep]
basepython = python3
# Do not install any requirements. We want this to be fast and work even if
# system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed


Loading…
Cancel
Save