tox cleanups

'skip_basepython_conflicts' has been the cause of a couple of bugs in
tox 4 and there is talk of it going away. Remove it and fix up a few
other issues in the tox.ini file.

Change-Id: Ic19c896af2ab0cf3570c43e8ceb8cba64fb45cdd
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2023-01-13 12:00:40 +00:00 committed by Tobias Urdin
parent 9f710ce6cd
commit 7505316902
2 changed files with 53 additions and 43 deletions

View File

@ -11,10 +11,10 @@
# this package here. # this package here.
# inspired from project-config install-distro-packages.sh # inspired from project-config install-distro-packages.sh
if apt-get -v >/dev/null 2>&1 ; then #if apt-get -v >/dev/null 2>&1 ; then
sudo add-apt-repository -y ppa:qpid/testing # sudo add-apt-repository -y ppa:qpid/testing
sudo apt-get -qq update # sudo apt-get -qq update
sudo PATH=/usr/sbin:/sbin:$PATH DEBIAN_FRONTEND=noninteractive \ # sudo PATH=/usr/sbin:/sbin:$PATH DEBIAN_FRONTEND=noninteractive \
apt-get -q --option "Dpkg::Options::=--force-confold" \ # apt-get -q --option "Dpkg::Options::=--force-confold" \
--assume-yes install qdrouterd # --assume-yes install qdrouterd
fi #fi

82
tox.ini
View File

@ -1,21 +1,18 @@
[tox] [tox]
minversion = 3.18.0 minversion = 3.18.0
envlist = py3,pep8 envlist = py3, pep8
ignore_basepython_conflict = true
[testenv] [testenv]
basepython = python3 passenv =
setenv = OS_*
VIRTUAL_ENV={envdir} ZUUL_CACHE_DIR
passenv = OS_* REQUIREMENTS_PIP_LOCATION
ZUUL_CACHE_DIR
REQUIREMENTS_PIP_LOCATION
install_command = pip install {opts} {packages}
deps = deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
commands = stestr run --slowest {posargs} commands =
stestr run --slowest {posargs}
[testenv:pep8] [testenv:pep8]
commands = commands =
@ -25,7 +22,7 @@ commands =
[testenv:cover] [testenv:cover]
setenv = setenv =
PYTHON=coverage run --source oslo_messaging --parallel-mode PYTHON=coverage run --source oslo_messaging --parallel-mode
commands = commands =
stestr run --slowest {posargs} stestr run --slowest {posargs}
coverage combine coverage combine
@ -37,14 +34,15 @@ commands = {posargs}
[testenv:docs] [testenv:docs]
allowlist_externals = rm allowlist_externals = rm
deps = -r{toxinidir}/doc/requirements.txt deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands = commands =
rm -fr doc/build rm -fr doc/build
sphinx-build -W --keep-going -b html doc/source doc/build/html sphinx-build -W --keep-going -b html doc/source doc/build/html
#
# The following functional test scenarios are defined for the # The following functional test scenarios are defined for the
# testing of the messaging backends and to demonstrated the functiona # testing of the messaging backends and to demonstrated the functional
# correctness across driver combinations (e.g. RPC and Notify) # correctness across driver combinations (e.g. RPC and Notify)
# #
# RPC Notify # RPC Notify
@ -56,42 +54,50 @@ commands =
# #
[testenv:py38-func-scenario01] [testenv:py38-func-scenario01]
setenv = setenv =
{[testenv]setenv} SCENARIO=scenario01
SCENARIO=scenario01 allowlist_externals =
commands = {toxinidir}/tools/setup-scenario-env.sh stestr run --slowest {posargs:oslo_messaging.tests.functional} {toxinidir}/tools/setup-scenario-env.sh
commands =
{toxinidir}/tools/setup-scenario-env.sh stestr run --slowest {posargs:oslo_messaging.tests.functional}
[testenv:py38-func-scenario02] [testenv:py38-func-scenario02]
setenv = setenv =
{[testenv]setenv} SCENARIO=scenario02
SCENARIO=scenario02 allowlist_externals =
commands = {toxinidir}/tools/setup-scenario-env.sh stestr run --slowest {posargs:oslo_messaging.tests.functional} {toxinidir}/tools/setup-scenario-env.sh
commands =
{toxinidir}/tools/setup-scenario-env.sh stestr run --slowest {posargs:oslo_messaging.tests.functional}
[testenv:py38-func-scenario03] [testenv:py38-func-scenario03]
setenv = setenv =
{[testenv]setenv} SCENARIO=scenario03
SCENARIO=scenario03 ENVNAME={envname}
ENVNAME={envname} WORKDIR={toxworkdir}
WORKDIR={toxworkdir} allowlist_externals =
commands = {toxinidir}/tools/setup-scenario-env.sh stestr run --slowest {posargs:oslo_messaging.tests.functional} {toxinidir}/tools/setup-scenario-env.sh
commands =
{toxinidir}/tools/setup-scenario-env.sh stestr run --slowest {posargs:oslo_messaging.tests.functional}
[testenv:py38-func-scenario04] [testenv:py38-func-scenario04]
setenv = setenv =
{[testenv]setenv} SCENARIO=scenario04
SCENARIO=scenario04 ENVNAME={envname}
ENVNAME={envname} WORKDIR={toxworkdir}
WORKDIR={toxworkdir} allowlist_externals =
commands = {toxinidir}/tools/setup-scenario-env.sh stestr run --slowest {posargs:oslo_messaging.tests.functional} {toxinidir}/tools/setup-scenario-env.sh
commands =
{toxinidir}/tools/setup-scenario-env.sh stestr run --slowest {posargs:oslo_messaging.tests.functional}
[testenv:bandit] [testenv:bandit]
# NOTE(kgiusti): This is required for the integration test job of the bandit # NOTE(kgiusti): This is required for the integration test job of the bandit
# project. Please do not remove. # project. Please do not remove.
commands = bandit -r oslo_messaging -x tests -n5 commands =
bandit -r oslo_messaging -x tests -n5
[flake8] [flake8]
# E731 skipped as assign a lambda expression
show-source = True show-source = True
enable-extensions = H203,H106 enable-extensions = H203,H106
# E731 skipped as assign a lambda expression
ignore = E731,H405,W504 ignore = E731,H405,W504
exclude = .tox,dist,doc,*.egg,build,__init__.py exclude = .tox,dist,doc,*.egg,build,__init__.py
@ -105,12 +111,16 @@ extension =
paths = ./oslo_messaging/hacking paths = ./oslo_messaging/hacking
[testenv:releasenotes] [testenv:releasenotes]
allowlist_externals = rm allowlist_externals =
rm
commands = commands =
rm -rf releasenotes/build rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
deps = -r{toxinidir}/doc/requirements.txt deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
[testenv:bindep] [testenv:bindep]
deps = bindep deps =
bindep
commands = bindep {posargs} commands = bindep {posargs}