tacker/tox.ini
Ai Hamano 5c29fafc5f Reduce the amount of time of Tacker v2 functional tests
This fix is for improving v2 functional tests by reducing the cost of
tests on zuul.
It implements (1), (2) and (4) as proposed in the following Spec:
* https://review.opendev.org/c/openstack/tacker-specs/+/932974
  * (1)Divide time consuming tests
    * tacker-functional-devstack-multinode-sol-v2-basic
      * tacker-ft-v2-df-userdata-ccvp
      * tacker-ft-v2-st-userdata-basic
      * tacker-ft-v2-st-userdata-ccvp
    * tacker-functional-devstack-multinode-sol-v2-vnflcm
      * tacker-ft-v2-df-userdata-basic-max
      * tacker-ft-v2-df-userdata-basic-min
      * tacker-ft-v2-df-userdata-update
      * tacker-ft-v2-df-userdata-scale
      * tacker-ft-v2-df-userdata-err-handling
    * tacker-functional-devstack-multinode-sol-v2-individual-vnfc-mgmt
      * tacker-ft-v2-st-userdata-basic-max
      * tacker-ft-v2-st-userdata-basic-min
      * tacker-ft-v2-st-userdata-err-handling
      * tacker-ft-v2-st-userdata-various-lcm
  * (2)Move tests less frequently updated to move to non-voting
    * tacker-functional-devstack-multinode-sol-v2-notification
    * tacker-functional-devstack-multinode-sol-v2-prometheus
    * tacker-functional-devstack-multinode-sol-separated-nfvo-v2
    * tacker-functional-devstack-multinode-sol-https-v2
    * tacker-functional-devstack-multinode-sol-encrypt-cred-barbican
    * tacker-functional-devstack-multinode-sol-encrypt-cred-local
    * tacker-functional-devstack-kubernetes-oidc-auth
    * tacker-functional-devstack-multinode-sol-v2-az-retry
    * tacker-functional-devstack-enhanced-policy-sol
    * tacker-functional-devstack-enhanced-policy-sol-kubernetes
    * tacker-functional-devstack-multinode-sol-terraform-v2
  * (4)Rename each test scenarios and revise directory structure

Implements: blueprint reduce-ft-time
Change-Id: I98efef94b779a6a07a8841a85f6b7ba877f50444
Depends-On: I2deb71242f555bbae5ee7c798add18490cb38344
2024-11-28 15:34:52 +09:00

328 lines
9.6 KiB
INI

[tox]
envlist = py310,py39,py38,py36,pep8,docs
minversion = 4.11.0
ignore_basepython_conflict = True
[testenv]
basepython = python3
setenv = VIRTUAL_ENV={envdir}
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
passenv =
TOX_CONSTRAINTS_FILE
OS_DEBUG
usedevelop = True
allowlist_externals = rm
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
stestr run --slowest --concurrency 1 {posargs}
[testenv:ft-legacy-vim]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol/legacy_nfvo run --slowest --concurrency 1 {posargs}
[testenv:ft-v1-tosca-vnflcm]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol/vnflcm run --slowest --concurrency 1 {posargs}
[testenv:ft-v1-userdata-vnflcm]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol/vnflcm_userdata run --slowest --concurrency 1 {posargs}
[testenv:ft-v1-vnfpkgm]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol/vnfpkgm run --slowest --concurrency 1 {posargs}
[testenv:ft-v1-userdata-separated-nfvo]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_separated_nfvo run --slowest --concurrency 1 {posargs}
[testenv:ft-v2-df-userdata-separated-nfvo]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_separated_nfvo_v2 run --slowest --concurrency 1 {posargs}
[testenv:ft-v1-k8s]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_kubernetes run --slowest --concurrency 2 {posargs}
[testenv:ft-v2-df-userdata-ccvp]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_v2/vnflcm/df_userdata/change_vnfpkg run --slowest {posargs}
[testenv:ft-v2-st-userdata-basic]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_v2/vnflcm/st_userdata/basic run --slowest {posargs}
[testenv:ft-v2-st-userdata-ccvp]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_v2/vnflcm/st_userdata/change_vnfpkg run --slowest {posargs}
[testenv:ft-v2-df-userdata-basic-max]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_v2/vnflcm/df_userdata/basic_max run --slowest {posargs}
[testenv:ft-v2-df-userdata-basic-min]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_v2/vnflcm/df_userdata/basic_min run --slowest {posargs}
[testenv:ft-v2-df-userdata-update]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_v2/vnflcm/df_userdata/update run --slowest {posargs}
[testenv:ft-v2-df-userdata-scale]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_v2/vnflcm/df_userdata/scale run --slowest {posargs}
[testenv:ft-v2-df-userdata-err-handling]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_v2/vnflcm/df_userdata/err_handling run --slowest {posargs}
[testenv:ft-v2-df-userdata-notification]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_v2/notification run --slowest --concurrency 1 {posargs}
[testenv:ft-v2-prometheus]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_v2/prometheus run --slowest --concurrency 1 {posargs}
[testenv:ft-v2-st-userdata-basic-max]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_v2/vnflcm/st_userdata/basic_max run --slowest {posargs}
[testenv:ft-v2-st-userdata-basic-min]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_v2/vnflcm/st_userdata/basic_min run --slowest {posargs}
[testenv:ft-v2-st-userdata-various-lcm]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_v2/vnflcm/st_userdata/various_lcm run --slowest {posargs}
[testenv:ft-v2-st-userdata-err-handling]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_v2/vnflcm/st_userdata/err_handling run --slowest {posargs}
[testenv:ft-v2-k8s]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_kubernetes_v2 run --slowest --concurrency 1 {posargs}
[testenv:ft-k8s-oidc-auth]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_kubernetes_oidc_auth run --slowest --concurrency 1 {posargs}
[testenv:ft-v1-userdata-multi-tenant]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_multi_tenant run --slowest --concurrency 1 {posargs}
[testenv:ft-v1-k8s-multi-tenant]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_kubernetes_multi_tenant run --slowest --concurrency 1 {posargs}
[testenv:ft-v2-st-userdata-az-retry]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_v2_az_retry run --slowest --concurrency 1 {posargs}
[testenv:ft-enhanced-policy-sol]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_enhanced_policy/sol run --slowest --concurrency 1 {posargs}
[testenv:ft-k8s-enhanced-policy-sol]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_enhanced_policy/sol_kubernetes run --slowest --concurrency 1 {posargs}
[testenv:ft-v2-df-userdata-https]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_https_v2 run --slowest --concurrency 1 {posargs}
[testenv:ft-v2-df-userdata-encrypt-cred-barbican]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_encrypt_cred_v2 run --slowest --concurrency 1 {posargs}
[testenv:ft-v2-df-userdata-encrypt-cred-local]
setenv = {[testenv]setenv}
# Temporarily change directory permissions to read the contents of the fernet
# key file from the test code.
commands_pre =
sudo su stack -c 'chmod 755 /etc/tacker/crypt/fernet_keys'
commands =
stestr --test-path=./tacker/tests/functional/sol_encrypt_cred_v2 run --slowest --concurrency 1 {posargs}
commands_post =
sudo su stack -c 'chmod 700 /etc/tacker/crypt/fernet_keys'
allowlist_externals =
sudo
[testenv:ft-v2-terraform]
setenv = {[testenv]setenv}
commands =
stestr --test-path=./tacker/tests/functional/sol_terraform_v2 run --slowest --concurrency 1 {posargs}
[testenv:ft-v1-compliance-sol]
passenv =
{[testenv]passenv}
*_PROXY
commands_pre =
git clone https://forge.etsi.org/rep/nfv/api-tests.git
git -C api-tests checkout 2.6.1-fix-plu
pip install -U -r{envdir}/api-tests/requirements.txt
commands =
stestr --test-path={toxinidir}/tacker/tests/compliance --top-dir={toxinidir} run --slowest --concurrency 1 {posargs}
commands_post =
rm -rf api-tests
allowlist_externals =
git
rm
changedir = {envdir}
[testenv:debug]
# NOTE(yasufum): Give optional test dir with `-t` explicitly because it cannot
# be found in oslo_debug_helper correctly for a deprecated warning from
# easy_install. It's needed until the warning is fixed.
commands = oslo_debug_helper -t tacker/tests {posargs}
[testenv:pep8]
deps = -r{toxinidir}/doc/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
flake8
doc8 -e .rst doc/source/ CONTRIBUTING.rst HACKING.rst README.rst TESTING.rst
tacker-db-manage check_migration
allowlist_externals = bash
[testenv:docs]
allowlist_externals =
sphinx-build
deps =
-r{toxinidir}/doc/requirements.txt
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
commands =
sphinx-build -W -b html doc/source doc/build/html
oslopolicy-sample-generator --config-file=etc/tacker-policy-generator.conf
[testenv:api-ref]
deps = {[testenv:docs]deps}
commands =
rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
allowlist_externals = rm
[testenv:releasenotes]
deps = {[testenv:docs]deps}
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:cover]
setenv =
PYTHON=coverage run --source tacker --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:venv]
commands = {posargs}
[flake8]
# E128 continuation line under-indented for visual indent
# N320 log messages does not translate
# W503 line break before binary operator
# W504 line break after binary operator
ignore = E128,N320,W503,W504
show-source = true
builtins = _
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,.ropeproject
[hacking]
import_exceptions = tacker._i18n
[flake8:local-plugins]
extension =
N320 = checks:validate_log_translations
T301 = checks:no_log_warn
paths = ./tacker/hacking
[testenv:config-gen]
commands =
oslo-config-generator --config-file=etc/config-generator.conf
[testenv:genpolicy]
commands =
oslopolicy-sample-generator --config-file=etc/tacker-policy-generator.conf
[testenv:bindep]
# 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
# separately, outside of the requirements files, and develop mode disabled
# explicitly to avoid unnecessarily installing the checked-out repo too (this
# further relies on "tox.skipsdist = True" above).
deps = bindep
commands = bindep test