a26d75e34e
OpenStack Project Testing Interface[1] extabilish a set of rules to make sure project testing interface looks similarly between OpenStack projects. This is intended to be the first change in such direction. Major improvements are: - Remove code coverage from unit tests environments - Reorganize tox.ini to better separate type of envs in sections - Create an [openstack] section to unify settings for environments that would require connecting to OpenStack (functional, scenarion, ...) - Create scenario env to exectute all scenarion tests including Neutron ones. - Point to the new URL for upstream upper hand global requirements file. Know missing things are: - Create docs environment - Create functional environment - Create cover environment [1] https://governance.openstack.org/tc/reference/project-testing-interface.html Change-Id: I0129e91b9fd58ac75223c8faca43e690a39061b5
155 lines
3.2 KiB
INI
155 lines
3.2 KiB
INI
[tox]
|
|
envlist = pep8,pylint,py36,py27
|
|
minversion = 2.3.2
|
|
|
|
|
|
# --- unit test environments -------------------------------------------------
|
|
|
|
[base]
|
|
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/extra-requirements.txt
|
|
|
|
passenv =
|
|
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
PYTHONWARNINGS=ignore::Warning,{env:PYTHONWARNINGS:}
|
|
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
|
|
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
|
|
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
|
|
PYTHON=python
|
|
|
|
commands =
|
|
stestr run --black-regex "{env:OS_BLACK_REGEX:}" {posargs}
|
|
|
|
|
|
[testenv]
|
|
|
|
usedevelop = True
|
|
|
|
deps =
|
|
{[base]deps}
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
passenv = {[base]passenv}
|
|
|
|
setenv =
|
|
{[base]setenv}
|
|
OS_BLACK_REGEX=tobiko.tests.scenario
|
|
|
|
commands = {[base]commands}
|
|
|
|
|
|
# --- static analisys environments -------------------------------------------
|
|
|
|
[testenv:pep8]
|
|
|
|
basepython = python3
|
|
|
|
commands = flake8
|
|
|
|
deps =
|
|
{[testenv]deps}
|
|
-r{toxinidir}/pep8-requirements.txt
|
|
-r{toxinidir}/pylint-requirements.txt
|
|
|
|
|
|
[testenv:pylint]
|
|
|
|
envdir = {toxworkdir}/pep8
|
|
|
|
basepython = python3
|
|
|
|
commands = pylint -j0 -E --rcfile=.pylintrc -e W,E tobiko
|
|
|
|
deps = {[testenv:pep8]deps}
|
|
|
|
|
|
[flake8]
|
|
# E125 continuation line does not distinguish itself from next logical line
|
|
# E126 continuation line over-indented for hanging indent
|
|
# E128 continuation line under-indented for visual indent
|
|
# E129 visually indented line with same indent as next logical line
|
|
# E265 block comment should start with '# '
|
|
# H404 multi line docstring should start with a summary
|
|
# H405 multi line docstring summary not separated with an empty line
|
|
# N530 direct neutron imports not allowed
|
|
ignore = E125,E126,E128,E129,E265,H404,H405,N530
|
|
|
|
# H106: Don't put vim configuration in source files
|
|
# H203: Use assertIs(Not)None to check for None
|
|
# H904: Delay string interpolations at logging calls
|
|
enable-extensions = H106,H203,H904
|
|
show-source = true
|
|
exclude = ./.*,build,dist,doc,*egg*,releasenotes
|
|
import-order-style = pep8
|
|
|
|
|
|
# --- integration test environments ------------------------------------------
|
|
|
|
[openstack]
|
|
|
|
deps = {[base]deps}
|
|
|
|
passenv = {[base]passenv}
|
|
*_proxy
|
|
OS_*
|
|
|
|
setenv = {[base]setenv}
|
|
|
|
commands = {[base]commands}
|
|
|
|
|
|
[testenv:scenario]
|
|
|
|
deps = {[openstack]deps}
|
|
|
|
passenv = {[openstack]passenv}
|
|
|
|
setenv = {[openstack]setenv}
|
|
OS_TEST_PATH={toxinidir}/tobiko/tests/scenario
|
|
|
|
|
|
[testenv:neutron]
|
|
|
|
envdir = {toxworkdir}/scenario
|
|
|
|
deps = {[testenv:scenario]deps}
|
|
|
|
passenv = {[testenv:scenario]passenv}
|
|
|
|
setenv = {[testenv:scenario]setenv}
|
|
OS_TEST_PATH={toxinidir}/tobiko/tests/scenario/neutron
|
|
|
|
|
|
# --- documentation environments ---------------------------------------------
|
|
|
|
|
|
[testenv:releasenotes]
|
|
|
|
basepython = python3
|
|
|
|
deps = -r{toxinidir}/docs/requirements.txt
|
|
|
|
commands =
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
|
|
|
|
# --- other envs -------------------------------------------------------------
|
|
|
|
|
|
[testenv:venv]
|
|
|
|
basepython = python3
|
|
|
|
commands = {posargs}
|
|
|
|
deps = {[openstack]deps}
|
|
|
|
setenv = {[openstack]setenv}
|
|
|
|
passenv = {[openstack]setenv}
|