hacking 1.0+ adds a couple of additional checks that are helpful as part of the transition to Python 3. However, hacking 1.1.0 incorporated flake8 2.6.x, which transitioned from pep8 to pycodestyle. Tempest provides some hacking extensions and these use pep8 imports. As things stand, projects that wish to use these hacking extensions must either constrain themselves to the same older hacking versions or install pep8 manually. Neither of these approaches is particularly attractive so instead transition to hacking 1.1.0 ourselves. This has the benefit of giving us the additional checks for Python 3. Change-Id: I09e3d2461366bb439bcb817149ce807a232acfbb
222 lines
7.2 KiB
INI
222 lines
7.2 KiB
INI
[tox]
|
|
envlist = pep8,py35,py27,pip-check-reqs
|
|
minversion = 2.3.1
|
|
skipsdist = True
|
|
|
|
[tempestenv]
|
|
sitepackages = False
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
OS_TEST_PATH=./tempest/test_discover
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
[testenv]
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
OS_LOG_CAPTURE=1
|
|
OS_STDOUT_CAPTURE=1
|
|
OS_STDERR_CAPTURE=1
|
|
OS_TEST_TIMEOUT=160
|
|
PYTHONWARNINGS=default::DeprecationWarning,ignore::DeprecationWarning:distutils,ignore::DeprecationWarning:site
|
|
passenv = OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_TEST_TIMEOUT OS_TEST_LOCK_PATH TEMPEST_CONFIG TEMPEST_CONFIG_DIR http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY ZUUL_CACHE_DIR REQUIREMENTS_PIP_LOCATION GENERATE_TEMPEST_PLUGIN_LIST
|
|
usedevelop = True
|
|
install_command = pip install {opts} {packages}
|
|
whitelist_externals = *
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
stestr --test-path ./tempest/tests run {posargs}
|
|
|
|
[testenv:genconfig]
|
|
commands = oslo-config-generator --config-file tempest/cmd/config-generator.tempest.conf
|
|
|
|
[testenv:cover]
|
|
setenv =
|
|
{[testenv]setenv}
|
|
PYTHON=coverage run --source tempest --parallel-mode
|
|
commands =
|
|
coverage erase
|
|
find . -type f -name "*.pyc" -delete
|
|
stestr --test-path ./tempest/tests run {posargs}
|
|
coverage combine
|
|
coverage html -d cover
|
|
coverage xml -o cover/coverage.xml
|
|
coverage report
|
|
|
|
[testenv:all]
|
|
envdir = .tox/tempest
|
|
sitepackages = {[tempestenv]sitepackages}
|
|
# 'all' includes slow tests
|
|
setenv =
|
|
{[tempestenv]setenv}
|
|
OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:1200}
|
|
deps = {[tempestenv]deps}
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
tempest run --regex {posargs}
|
|
|
|
[testenv:all-plugin]
|
|
sitepackages = True
|
|
# 'all' includes slow tests
|
|
setenv =
|
|
{[tempestenv]setenv}
|
|
OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:1200}
|
|
deps = {[tempestenv]deps}
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
tempest run --regex {posargs}
|
|
|
|
[testenv:full]
|
|
envdir = .tox/tempest
|
|
sitepackages = {[tempestenv]sitepackages}
|
|
setenv = {[tempestenv]setenv}
|
|
deps = {[tempestenv]deps}
|
|
# The regex below is used to select which tests to run and exclude the slow tag:
|
|
# See the testrepository bug: https://bugs.launchpad.net/testrepository/+bug/1208610
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
tempest run --regex '(?!.*\[.*\bslow\b.*\])(^tempest\.api)' {posargs}
|
|
tempest run --combine --serial --regex '(?!.*\[.*\bslow\b.*\])(^tempest\.scenario)' {posargs}
|
|
|
|
[testenv:full-parallel]
|
|
envdir = .tox/tempest
|
|
sitepackages = {[tempestenv]sitepackages}
|
|
setenv = {[tempestenv]setenv}
|
|
deps = {[tempestenv]deps}
|
|
# The regex below is used to select all tempest scenario and including the non slow api tests
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
tempest run --regex '(^tempest\.scenario.*)|(?!.*\[.*\bslow\b.*\])(^tempest\.api)' {posargs}
|
|
|
|
[testenv:full-serial]
|
|
envdir = .tox/tempest
|
|
sitepackages = {[tempestenv]sitepackages}
|
|
setenv = {[tempestenv]setenv}
|
|
deps = {[tempestenv]deps}
|
|
# The regex below is used to select which tests to run and exclude the slow tag:
|
|
# See the testrepository bug: https://bugs.launchpad.net/testrepository/+bug/1208610
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
tempest run --serial --regex '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario))' {posargs}
|
|
|
|
[testenv:scenario]
|
|
envdir = .tox/tempest
|
|
sitepackages = {[tempestenv]sitepackages}
|
|
setenv = {[tempestenv]setenv}
|
|
deps = {[tempestenv]deps}
|
|
# The regex below is used to select all scenario tests
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
tempest run --serial --regex '(^tempest\.scenario)' {posargs}
|
|
|
|
[testenv:smoke]
|
|
envdir = .tox/tempest
|
|
sitepackages = {[tempestenv]sitepackages}
|
|
setenv = {[tempestenv]setenv}
|
|
deps = {[tempestenv]deps}
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
tempest run --regex '\[.*\bsmoke\b.*\]' {posargs}
|
|
|
|
[testenv:smoke-serial]
|
|
envdir = .tox/tempest
|
|
sitepackages = {[tempestenv]sitepackages}
|
|
setenv = {[tempestenv]setenv}
|
|
deps = {[tempestenv]deps}
|
|
# This is still serial because neutron doesn't work with parallel. See:
|
|
# https://bugs.launchpad.net/tempest/+bug/1216076 so the neutron smoke
|
|
# job would fail if we moved it to parallel.
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
tempest run --serial --regex '\[.*\bsmoke\b.*\]' {posargs}
|
|
|
|
[testenv:venv]
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands = {posargs}
|
|
|
|
[testenv:venv-tempest]
|
|
envdir = .tox/tempest
|
|
sitepackages = {[tempestenv]sitepackages}
|
|
setenv = {[tempestenv]setenv}
|
|
deps = {[tempestenv]deps}
|
|
commands = {posargs}
|
|
|
|
[testenv:docs]
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
rm -rf doc/build
|
|
sphinx-build -W -b html doc/source doc/build/html
|
|
whitelist_externals = rm
|
|
|
|
[testenv:pep8]
|
|
commands =
|
|
flake8 {posargs}
|
|
check-uuid
|
|
|
|
[testenv:uuidgen]
|
|
commands =
|
|
check-uuid --fix
|
|
|
|
[hacking]
|
|
local-check-factory = tempest.hacking.checks.factory
|
|
import_exceptions = tempest.services
|
|
|
|
[flake8]
|
|
# E125 is a won't fix until https://github.com/jcrocholl/pep8/issues/126 is resolved. For further detail see https://review.openstack.org/#/c/36788/
|
|
# E123 skipped because it is ignored by default in the default pep8
|
|
# E129 skipped because it is too limiting when combined with other rules
|
|
# W504 skipped because it is overeager and unnecessary
|
|
ignore = E125,E123,E129,W504
|
|
show-source = True
|
|
exclude = .git,.venv,.tox,dist,doc,*egg,build
|
|
enable-extensions = H106,H203,H904
|
|
import-order-style = pep8
|
|
|
|
[testenv:releasenotes]
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
rm -rf releasenotes/build
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees \
|
|
-b html releasenotes/source releasenotes/build/html
|
|
whitelist_externals = rm
|
|
|
|
[testenv:pip-check-reqs]
|
|
# Do not install test-requirements as that will pollute the virtualenv for
|
|
# determining missing packages.
|
|
# This also means that pip-check-reqs must be installed separately, outside
|
|
# of the requirements.txt files
|
|
deps = pip_check_reqs
|
|
-r{toxinidir}/requirements.txt
|
|
commands=
|
|
pip-extra-reqs -d --ignore-file=tempest/tests/* tempest
|
|
pip-missing-reqs -d --ignore-file=tempest/tests/* tempest
|
|
|
|
|
|
[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.
|
|
deps = bindep
|
|
commands = bindep test
|
|
|
|
[testenv:plugin-sanity-check]
|
|
# perform tempest plugin sanity
|
|
whitelist_externals = bash
|
|
commands =
|
|
bash tools/tempest-plugin-sanity.sh
|