Refactor tox.ini to match OpenStack Project Testing Interface
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
This commit is contained in:
parent
a0c598cd3d
commit
a26d75e34e
180
tox.ini
180
tox.ini
@ -1,130 +1,72 @@
|
||||
[tox]
|
||||
envlist = pep8,pylint,py36,py27
|
||||
|
||||
minversion = 2.0
|
||||
minversion = 2.3.2
|
||||
|
||||
|
||||
[tobiko]
|
||||
# --- unit test environments -------------------------------------------------
|
||||
|
||||
[base]
|
||||
|
||||
deps =
|
||||
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
||||
-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]
|
||||
|
||||
commands =
|
||||
find . -type f -name ".coverage*" -delete
|
||||
find . -type f -name "*.pyc" -delete
|
||||
coverage erase
|
||||
stestr --test-path ./tobiko/tests run --black-regex 'scenario' {posargs}
|
||||
coverage combine
|
||||
coverage html -d cover
|
||||
coverage xml -o cover/coverage.xml
|
||||
coverage report
|
||||
find . -type f -name ".coverage*" -delete
|
||||
|
||||
deps =
|
||||
{[tobiko]deps}
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
-r{toxinidir}/extra-requirements.txt
|
||||
|
||||
setenv =
|
||||
{[tobiko]setenv}
|
||||
PYTHON=coverage run --source tobiko --parallel-mode
|
||||
|
||||
usedevelop = True
|
||||
|
||||
whitelist_externals=
|
||||
find
|
||||
|
||||
|
||||
[testenv:neutron]
|
||||
|
||||
commands =
|
||||
stestr --test-path ./tobiko/tests/scenario/neutron run {posargs}
|
||||
|
||||
deps =
|
||||
{[tobiko]deps}
|
||||
-r{toxinidir}/neutron-requirements.txt
|
||||
{[base]deps}
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
|
||||
passenv = {[base]passenv}
|
||||
|
||||
setenv =
|
||||
{[tobiko]setenv}
|
||||
PYTHON=python
|
||||
{[base]setenv}
|
||||
OS_BLACK_REGEX=tobiko.tests.scenario
|
||||
|
||||
passenv =
|
||||
http_proxy
|
||||
https_proxy
|
||||
no_proxy
|
||||
OS_USER_DOMAIN_NAME
|
||||
OS_IMAGE_API_VERSION
|
||||
OS_PROJECT_NAME
|
||||
OS_IDENTITY_API_VERSION
|
||||
OS_PASSWORD
|
||||
OS_AUTH_TYPE
|
||||
OS_AUTH_URL
|
||||
OS_USERNAME
|
||||
OS_VOLUME_API_VERSION
|
||||
OS_NO_CACHE
|
||||
OS_CLOUDNAME
|
||||
OS_PROJECT_DOMAIN_NAME
|
||||
commands = {[base]commands}
|
||||
|
||||
[testenv:venv]
|
||||
basepython = python3
|
||||
|
||||
commands =
|
||||
{posargs}
|
||||
|
||||
deps =
|
||||
{[testenv]deps}
|
||||
{[testenv:neutron]deps}
|
||||
|
||||
setenv =
|
||||
{[tobiko]setenv}
|
||||
PYTHON=python
|
||||
# --- static analisys environments -------------------------------------------
|
||||
|
||||
[testenv:pep8]
|
||||
|
||||
basepython = python3
|
||||
|
||||
commands =
|
||||
flake8
|
||||
commands = flake8
|
||||
|
||||
deps =
|
||||
{[testenv]deps}
|
||||
{[testenv:neutron]deps}
|
||||
-r{toxinidir}/pep8-requirements.txt
|
||||
|
||||
setenv =
|
||||
{[tobiko]setenv}
|
||||
PYTHON=python
|
||||
-r{toxinidir}/pylint-requirements.txt
|
||||
|
||||
|
||||
[testenv:pylint]
|
||||
|
||||
envdir = {toxworkdir}/pep8
|
||||
|
||||
basepython = python3
|
||||
|
||||
commands =
|
||||
pylint -j0 -E --rcfile=.pylintrc -e W,E tobiko
|
||||
commands = pylint -j0 -E --rcfile=.pylintrc -e W,E tobiko
|
||||
|
||||
deps =
|
||||
{[testenv]deps}
|
||||
{[testenv:neutron]deps}
|
||||
-r{toxinidir}/pylint-requirements.txt
|
||||
deps = {[testenv:pep8]deps}
|
||||
|
||||
setenv =
|
||||
{[tobiko]setenv}
|
||||
PYTHON=python
|
||||
|
||||
[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
|
||||
|
||||
[flake8]
|
||||
# E125 continuation line does not distinguish itself from next logical line
|
||||
@ -144,3 +86,69 @@ 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}
|
||||
|
Loading…
Reference in New Issue
Block a user