Add tox.ini testenv descriptions

Add descriptions for each test that can be run.

TrivialFix

Change-Id: I7314e4c1ee82182cdd6ae12734e8a5f9cadae0e2
This commit is contained in:
Brian Haley 2024-04-29 17:23:56 -04:00
parent 22a3384194
commit a5ee7497b0
1 changed files with 45 additions and 0 deletions

45
tox.ini
View File

@ -5,6 +5,8 @@ skipsdist = False
ignore_basepython_conflict = True ignore_basepython_conflict = True
[testenv] [testenv]
description =
Run unit tests.
basepython = {env:TOX_PYTHON:python3} basepython = {env:TOX_PYTHON:python3}
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true} OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
@ -36,6 +38,8 @@ commands =
# mode. To do this define the TRACE_FAILONLY environmental variable. # mode. To do this define the TRACE_FAILONLY environmental variable.
[testenv:debug] [testenv:debug]
description =
Run specified tests through oslo_debug_helper, which allows use of pdb.
commands = oslo_debug_helper -t neutron/tests {posargs} commands = oslo_debug_helper -t neutron/tests {posargs}
[testenv:common] [testenv:common]
@ -53,6 +57,8 @@ setenv = OS_SUDO_TESTING=1
commands = false commands = false
[testenv:functional] [testenv:functional]
description =
Run functional tests.
setenv = {[testenv]setenv} setenv = {[testenv]setenv}
{[testenv:common]setenv} {[testenv:common]setenv}
OS_TEST_PATH=./neutron/tests/functional OS_TEST_PATH=./neutron/tests/functional
@ -65,6 +71,8 @@ deps =
-r{toxinidir}/neutron/tests/functional/requirements.txt -r{toxinidir}/neutron/tests/functional/requirements.txt
[testenv:dsvm-functional] [testenv:dsvm-functional]
description =
Run functional tests that require sudo privileges.
setenv = {[testenv:functional]setenv} setenv = {[testenv:functional]setenv}
{[testenv:dsvm]setenv} {[testenv:dsvm]setenv}
deps = deps =
@ -74,6 +82,8 @@ commands =
stestr run {posargs} stestr run {posargs}
[testenv:dsvm-functional-gate] [testenv:dsvm-functional-gate]
description =
Run functional gate tests that require sudo privileges.
setenv = {[testenv:dsvm-functional]setenv} setenv = {[testenv:dsvm-functional]setenv}
deps = {[testenv:dsvm-functional]deps} deps = {[testenv:dsvm-functional]deps}
commands = commands =
@ -82,6 +92,8 @@ commands =
stestr run --slowest --combine --concurrency 1 (.*MySQL\.|.*PostgreSQL\.|.*test_get_all_devices|.*TestMetadataAgent\.|.*BaseOVSTestCase\.) {posargs} stestr run --slowest --combine --concurrency 1 (.*MySQL\.|.*PostgreSQL\.|.*test_get_all_devices|.*TestMetadataAgent\.|.*BaseOVSTestCase\.) {posargs}
[testenv:dsvm-fullstack] [testenv:dsvm-fullstack]
description =
Run fullstack tests.
setenv = {[testenv]setenv} setenv = {[testenv]setenv}
{[testenv:common]setenv} {[testenv:common]setenv}
{[testenv:dsvm]setenv} {[testenv:dsvm]setenv}
@ -99,6 +111,8 @@ commands =
stestr run --concurrency 2 {posargs} stestr run --concurrency 2 {posargs}
[testenv:dsvm-fullstack-gate] [testenv:dsvm-fullstack-gate]
description =
Run fullstack gate tests that require sudo privileges.
setenv = {[testenv:dsvm-fullstack]setenv} setenv = {[testenv:dsvm-fullstack]setenv}
deps = {[testenv:dsvm-fullstack]deps} deps = {[testenv:dsvm-fullstack]deps}
commands = commands =
@ -108,10 +122,14 @@ commands =
stestr run --slowest --combine --concurrency 1 neutron.tests.fullstack.test_securitygroup.TestSecurityGroupsSameNetwork.test_securitygroup {posargs} stestr run --slowest --combine --concurrency 1 neutron.tests.fullstack.test_securitygroup.TestSecurityGroupsSameNetwork.test_securitygroup {posargs}
[testenv:releasenotes] [testenv:releasenotes]
description =
Build release note documentation in HTML format.
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:pep8] [testenv:pep8]
description =
Run style and lint checks.
deps = deps =
{[testenv]deps} {[testenv]deps}
bashate>=2.1.1 # Apache-2.0 bashate>=2.1.1 # Apache-2.0
@ -133,6 +151,8 @@ commands=
allowlist_externals = bash allowlist_externals = bash
[testenv:cover] [testenv:cover]
description =
Run unit tests and generate coverage report.
setenv = setenv =
{[testenv]setenv} {[testenv]setenv}
PYTHON=coverage run --source neutron --parallel-mode PYTHON=coverage run --source neutron --parallel-mode
@ -144,9 +164,18 @@ commands =
coverage xml -o cover/coverage.xml coverage xml -o cover/coverage.xml
[testenv:venv] [testenv:venv]
description =
Run specified command in a virtual environment with all dependencies
installed.
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
-r{toxinidir}/requirements.txt
commands = {posargs} commands = {posargs}
[testenv:docs] [testenv:docs]
description =
Build documentation in HTML format.
# Do not remove requirements.txt from deps list as without it # Do not remove requirements.txt from deps list as without it
# upper constraints will not be used for deps listed in requirements.txt # upper constraints will not be used for deps listed in requirements.txt
# and may cause issues # and may cause issues
@ -157,6 +186,8 @@ deps =
commands = sphinx-build -W -b html doc/source doc/build/html commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs] [testenv:pdf-docs]
description =
Build documentation in PDF format.
deps = {[testenv:docs]deps} deps = {[testenv:docs]deps}
allowlist_externals = allowlist_externals =
make make
@ -165,6 +196,8 @@ commands =
make -C doc/build/pdf make -C doc/build/pdf
[testenv:linkcheck] [testenv:linkcheck]
description =
Build documentation link checks.
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b linkcheck doc/source doc/build/linkcheck commands = sphinx-build -W -b linkcheck doc/source doc/build/linkcheck
@ -220,11 +253,15 @@ extension =
import_exceptions = neutron._i18n import_exceptions = neutron._i18n
[testenv:bandit] [testenv:bandit]
description =
Run bandit security checks.
deps = {[testenv:pep8]deps} deps = {[testenv:pep8]deps}
# B104: Possible binding to all interfaces # B104: Possible binding to all interfaces
commands = bandit -r neutron -x tests -n5 -s B104 commands = bandit -r neutron -x tests -n5 -s B104
[testenv:bashate] [testenv:bashate]
description =
Run bashate checks.
deps = {[testenv:pep8]deps} deps = {[testenv:pep8]deps}
commands = bash -c "find {toxinidir} \ commands = bash -c "find {toxinidir} \
-not \( -type d -name .tox\* -prune \) \ -not \( -type d -name .tox\* -prune \) \
@ -238,14 +275,20 @@ commands = bash -c "find {toxinidir} \
-print0 | xargs -0 bashate -v -iE006 -eE005,E042,E043" -print0 | xargs -0 bashate -v -iE006 -eE005,E042,E043"
[testenv:genconfig] [testenv:genconfig]
description =
Generate configuration example files.
commands = bash {toxinidir}/tools/generate_config_file_samples.sh commands = bash {toxinidir}/tools/generate_config_file_samples.sh
[testenv:genpolicy] [testenv:genpolicy]
description =
Generate policy example files.
commands = oslopolicy-sample-generator --config-file=etc/oslo-policy-generator/policy.conf commands = oslopolicy-sample-generator --config-file=etc/oslo-policy-generator/policy.conf
# This environment can be used to quickly validate that all needed system # This environment can be used to quickly validate that all needed system
# packages required to successfully execute test targets are installed # packages required to successfully execute test targets are installed
[testenv:bindep] [testenv:bindep]
description =
Run binary dependency checks.
# Do not install any requirements. We want this to be fast and work even if # 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 # system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed # dependencies are missing! This also means that bindep must be installed
@ -254,6 +297,8 @@ deps = bindep
commands = bindep test commands = bindep test
[testenv:requirements] [testenv:requirements]
description =
Run requirement checks.
deps = deps =
-egit+https://opendev.org/openstack/requirements#egg=openstack-requirements -egit+https://opendev.org/openstack/requirements#egg=openstack-requirements
allowlist_externals = bash allowlist_externals = bash