Drop redundant injection of VIRTUAL_ENV

tox automatically injects the environment so no manual override is
necessary.

Also remove basepython because tox uses the python version where tox
is installed by default, and we no longer expect that the tests may run
in env with python 2.

Change-Id: I9dc0c5d49b29557435f7b356fe3aaa5554849d93
This commit is contained in:
Takashi Kajinami
2025-04-14 21:19:28 +09:00
parent b670de7508
commit 4bb2b427ee

31
tox.ini
View File

@@ -1,13 +1,10 @@
[tox] [tox]
minversion = 3.18.0 minversion = 4.0.0
envlist = py3,pep8 envlist = py3,pep8
ignore_basepython_conflict = True
[testenv] [testenv]
usedevelop = True usedevelop = True
basepython = python3
setenv = setenv =
VIRTUAL_ENV={envdir}
OS_TEST_PATH=./castellan/tests/unit OS_TEST_PATH=./castellan/tests/unit
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}
@@ -30,14 +27,14 @@ commands = oslo_debug_helper {posargs}
[testenv:cover] [testenv:cover]
setenv = setenv =
PYTHON=coverage run --source castellan --parallel-mode PYTHON=coverage run --source castellan --parallel-mode
commands = commands =
coverage erase coverage erase
{[testenv]commands} {[testenv]commands}
coverage combine coverage combine
coverage html -d cover coverage html -d cover
coverage xml -o cover/coverage.xml coverage xml -o cover/coverage.xml
coverage report --show-missing coverage report --show-missing
[testenv:docs] [testenv:docs]
# This environment is called from CI scripts to test and publish # This environment is called from CI scripts to test and publish
@@ -68,25 +65,23 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen
[testenv:functional] [testenv:functional]
usedevelop = True usedevelop = True
setenv = setenv =
VIRTUAL_ENV={envdir} OS_TEST_PATH=./castellan/tests/functional
OS_TEST_PATH=./castellan/tests/functional
commands = stestr run --slowest --concurrency=1 {posargs} commands = stestr run --slowest --concurrency=1 {posargs}
[testenv:functional-vault] [testenv:functional-vault]
passenv = HOME passenv = HOME
usedevelop = True usedevelop = True
setenv = setenv =
VIRTUAL_ENV={envdir} OS_TEST_PATH=./castellan/tests/functional
OS_TEST_PATH=./castellan/tests/functional
commands = commands =
{toxinidir}/tools/setup-vault-env.sh pifpaf -e VAULT_TEST run vault -- stestr run --concurrency=1 --slowest {posargs} {toxinidir}/tools/setup-vault-env.sh pifpaf -e VAULT_TEST run vault -- stestr run --concurrency=1 --slowest {posargs}
allowlist_externals = allowlist_externals =
{toxinidir}/tools/setup-vault-env.sh {toxinidir}/tools/setup-vault-env.sh
[testenv:genconfig] [testenv:genconfig]
commands = commands =
oslo-config-generator --config-file=etc/castellan/functional-config-generator.conf oslo-config-generator --config-file=etc/castellan/functional-config-generator.conf
oslo-config-generator --config-file=etc/castellan/sample-config-generator.conf oslo-config-generator --config-file=etc/castellan/sample-config-generator.conf
[flake8] [flake8]
# [H106] Don't put vim configuration in source files. # [H106] Don't put vim configuration in source files.