2012-01-10 17:44:27 -08:00
|
|
|
[tox]
|
2017-01-01 01:24:46 -08:00
|
|
|
envlist = docs,py35,py27,pep8
|
2017-06-05 14:08:14 +02:00
|
|
|
minversion = 2.3.2
|
2013-12-09 14:02:49 +00:00
|
|
|
skipsdist = True
|
2012-01-10 17:44:27 -08:00
|
|
|
|
|
|
|
[testenv]
|
2012-02-29 09:39:03 -08:00
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
2018-05-22 09:37:55 -07:00
|
|
|
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
|
|
|
|
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
|
|
|
|
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
|
2016-08-08 00:04:05 -04:00
|
|
|
PYTHONWARNINGS=default::DeprecationWarning
|
2016-01-13 18:31:57 +08:00
|
|
|
passenv = TRACE_FAILONLY GENERATE_HASHES http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
2013-12-09 14:02:49 +00:00
|
|
|
usedevelop = True
|
2015-09-01 15:10:54 +10:00
|
|
|
install_command =
|
2018-03-08 07:26:07 -06:00
|
|
|
pip install {opts} {packages}
|
|
|
|
deps =
|
2018-08-09 21:54:33 +00:00
|
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/rocky}
|
2018-03-08 07:26:07 -06:00
|
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2014-12-02 13:18:48 +09:00
|
|
|
whitelist_externals = sh
|
2018-05-22 09:37:55 -07:00
|
|
|
commands = stestr run {posargs}
|
2015-06-09 11:28:10 +02:00
|
|
|
# there is also secret magic in ostestr which lets you run in a fail only
|
2014-11-20 21:01:14 +00:00
|
|
|
# mode. To do this define the TRACE_FAILONLY environmental variable.
|
2012-06-08 19:46:37 -04:00
|
|
|
|
2018-04-28 00:05:40 +00:00
|
|
|
[testenv:debug]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2018-04-28 00:05:40 +00:00
|
|
|
commands = oslo_debug_helper -t neutron/tests {posargs}
|
|
|
|
|
2015-06-24 21:31:33 +02:00
|
|
|
[testenv:common]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2015-06-24 21:31:33 +02:00
|
|
|
# Fake job to define environment variables shared between dsvm/non-dsvm jobs
|
2017-09-12 15:11:03 -04:00
|
|
|
setenv = OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:180}
|
2015-06-24 21:31:33 +02:00
|
|
|
commands = false
|
|
|
|
|
|
|
|
[testenv:dsvm]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2015-06-24 21:31:33 +02:00
|
|
|
# Fake job to define environment variables shared between dsvm jobs
|
|
|
|
setenv = OS_SUDO_TESTING=1
|
|
|
|
OS_ROOTWRAP_CMD=sudo {envdir}/bin/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf
|
|
|
|
OS_ROOTWRAP_DAEMON_CMD=sudo {envdir}/bin/neutron-rootwrap-daemon {envdir}/etc/neutron/rootwrap.conf
|
|
|
|
OS_FAIL_ON_MISSING_DEPS=1
|
2016-04-08 15:34:28 -04:00
|
|
|
OS_LOG_PATH={env:OS_LOG_PATH:/opt/stack/logs}
|
2015-06-24 21:31:33 +02:00
|
|
|
commands = false
|
|
|
|
|
2014-01-14 18:43:22 +00:00
|
|
|
[testenv:functional]
|
2015-03-02 17:06:54 +11:00
|
|
|
basepython = python2.7
|
2015-06-23 20:00:30 +02:00
|
|
|
setenv = {[testenv]setenv}
|
2015-06-24 21:31:33 +02:00
|
|
|
{[testenv:common]setenv}
|
2015-06-23 20:00:30 +02:00
|
|
|
OS_TEST_PATH=./neutron/tests/functional
|
2016-04-08 15:34:28 -04:00
|
|
|
OS_LOG_PATH={env:OS_LOG_PATH:/opt/stack/logs}
|
2014-10-05 01:23:50 -04:00
|
|
|
deps =
|
|
|
|
{[testenv]deps}
|
|
|
|
-r{toxinidir}/neutron/tests/functional/requirements.txt
|
2014-01-14 18:43:22 +00:00
|
|
|
|
2017-05-24 13:13:39 -07:00
|
|
|
[testenv:functional-python35]
|
2016-07-03 14:55:38 -04:00
|
|
|
basepython = python3.5
|
|
|
|
setenv = {[testenv:functional]setenv}
|
|
|
|
deps =
|
|
|
|
{[testenv:functional]deps}
|
|
|
|
|
2014-07-02 00:35:12 +00:00
|
|
|
[testenv:dsvm-functional]
|
2015-03-02 17:06:54 +11:00
|
|
|
basepython = python2.7
|
2015-06-24 21:31:33 +02:00
|
|
|
setenv = {[testenv:functional]setenv}
|
|
|
|
{[testenv:dsvm]setenv}
|
2014-10-14 14:09:14 +03:00
|
|
|
deps =
|
|
|
|
{[testenv:functional]deps}
|
2016-02-11 09:51:54 -05:00
|
|
|
commands =
|
|
|
|
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
|
2018-05-22 09:37:55 -07:00
|
|
|
stestr run {posargs}
|
2014-10-14 14:09:14 +03:00
|
|
|
|
2017-05-24 13:13:39 -07:00
|
|
|
[testenv:dsvm-functional-python35]
|
2016-07-03 14:55:38 -04:00
|
|
|
basepython = python3.5
|
|
|
|
setenv = {[testenv:dsvm-functional]setenv}
|
|
|
|
deps =
|
|
|
|
{[testenv:dsvm-functional]deps}
|
2016-02-11 09:51:54 -05:00
|
|
|
commands =
|
|
|
|
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
|
2018-05-22 09:37:55 -07:00
|
|
|
stestr run {posargs}
|
2015-10-07 10:55:25 +02:00
|
|
|
|
2015-12-05 17:17:13 -05:00
|
|
|
[testenv:dsvm-fullstack]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python2.7
|
2015-06-23 20:00:30 +02:00
|
|
|
setenv = {[testenv]setenv}
|
2015-06-24 21:31:33 +02:00
|
|
|
{[testenv:common]setenv}
|
|
|
|
{[testenv:dsvm]setenv}
|
2016-03-10 16:51:28 +09:00
|
|
|
# workaround for DB teardown lock contention (bug/1541742)
|
2017-09-12 15:11:03 -04:00
|
|
|
OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:600}
|
2015-12-05 17:17:13 -05:00
|
|
|
OS_TEST_PATH=./neutron/tests/fullstack
|
2014-10-05 01:23:50 -04:00
|
|
|
deps =
|
|
|
|
{[testenv:functional]deps}
|
2017-04-11 12:27:46 -04:00
|
|
|
commands =
|
|
|
|
{toxinidir}/tools/generate_dhclient_script_for_fullstack.sh {envdir}
|
2017-04-23 22:02:40 +08:00
|
|
|
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
|
2018-05-22 09:37:55 -07:00
|
|
|
stestr run --concurrency 4 {posargs}
|
2014-07-02 00:35:12 +00:00
|
|
|
|
2017-06-26 21:28:14 +00:00
|
|
|
[testenv:dsvm-fullstack-python35]
|
|
|
|
basepython = python3.5
|
|
|
|
setenv = {[testenv:dsvm-fullstack]setenv}
|
|
|
|
deps =
|
|
|
|
{[testenv:dsvm-fullstack]deps}
|
|
|
|
commands =
|
|
|
|
{[testenv:dsvm-fullstack]commands}
|
|
|
|
|
2015-11-04 20:41:26 +00:00
|
|
|
[testenv:releasenotes]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2018-03-22 17:09:45 +09:00
|
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
2015-11-25 18:32:17 +00:00
|
|
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
2015-11-04 20:41:26 +00:00
|
|
|
|
2012-01-10 17:44:27 -08:00
|
|
|
[testenv:pep8]
|
2015-03-02 17:06:54 +11:00
|
|
|
basepython = python2.7
|
2015-02-25 09:07:18 -08:00
|
|
|
deps =
|
|
|
|
{[testenv]deps}
|
|
|
|
commands=
|
2014-12-22 13:02:14 -08:00
|
|
|
# If it is easier to add a check via a shell script, consider adding it in this file
|
|
|
|
sh ./tools/misc-sanity-checks.sh
|
2015-04-04 00:22:05 +00:00
|
|
|
{toxinidir}/tools/check_unit_test_structure.sh
|
2015-02-25 21:53:27 -08:00
|
|
|
# Checks for coding and style guidelines
|
2013-05-17 02:18:56 +00:00
|
|
|
flake8
|
2015-06-30 14:56:28 -04:00
|
|
|
sh ./tools/coding-checks.sh --pylint '{posargs}'
|
2015-06-09 12:46:54 +02:00
|
|
|
neutron-db-manage --config-file neutron/tests/etc/neutron.conf check_migration
|
2016-08-12 12:36:07 -04:00
|
|
|
python ./tools/list_moved_globals.py
|
2015-11-09 23:37:37 +00:00
|
|
|
{[testenv:genconfig]commands}
|
2017-01-31 16:52:42 -06:00
|
|
|
{[testenv:bashate]commands}
|
2017-07-28 17:50:41 -07:00
|
|
|
{[testenv:bandit]commands}
|
2015-04-07 15:00:25 +00:00
|
|
|
whitelist_externals =
|
|
|
|
sh
|
|
|
|
bash
|
2012-01-25 01:23:12 -08:00
|
|
|
|
|
|
|
[testenv:cover]
|
2015-03-02 17:06:54 +11:00
|
|
|
basepython = python2.7
|
2018-05-22 09:37:55 -07:00
|
|
|
setenv =
|
|
|
|
{[testenv]setenv}
|
|
|
|
PYTHON=coverage run --source neutron --parallel-mode
|
2013-03-10 15:23:46 -07:00
|
|
|
commands =
|
2018-05-22 09:37:55 -07:00
|
|
|
stestr run --no-subunit-trace {posargs}
|
|
|
|
coverage combine
|
2017-02-10 13:18:29 -06:00
|
|
|
coverage report --fail-under=82 --skip-covered
|
2018-05-22 09:37:55 -07:00
|
|
|
coverage html -d cover
|
|
|
|
coverage xml -o cover/coverage.xml
|
2012-01-10 17:44:27 -08:00
|
|
|
|
2012-06-08 19:46:37 -04:00
|
|
|
[testenv:venv]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2012-02-29 09:39:03 -08:00
|
|
|
commands = {posargs}
|
2013-05-17 02:18:56 +00:00
|
|
|
|
2014-08-21 21:24:51 +02:00
|
|
|
[testenv:docs]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2019-12-12 11:14:10 +01:00
|
|
|
envdir = {toxworkdir}/docs
|
|
|
|
deps =
|
|
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/rocky}
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
|
|
|
-r{toxinidir}/requirements.txt
|
2015-06-15 16:15:11 +02:00
|
|
|
commands = sphinx-build -W -b html doc/source doc/build/html
|
2014-08-21 21:24:51 +02:00
|
|
|
|
2017-09-19 10:37:29 -06:00
|
|
|
[testenv:linkcheck]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2018-03-22 17:09:45 +09:00
|
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
2017-09-19 10:37:29 -06:00
|
|
|
commands = sphinx-build -W -b linkcheck doc/source doc/build/linkcheck
|
|
|
|
|
2013-05-17 02:18:56 +00:00
|
|
|
[flake8]
|
|
|
|
# E125 continuation line does not distinguish itself from next logical line
|
2014-06-10 14:35:46 +00:00
|
|
|
# E126 continuation line over-indented for hanging indent
|
|
|
|
# E128 continuation line under-indented for visual indent
|
2014-12-09 13:04:38 -07:00
|
|
|
# H404 multi line docstring should start with a summary
|
2014-06-10 14:35:46 +00:00
|
|
|
# H405 multi line docstring summary not separated with an empty line
|
2017-04-12 16:43:44 -07:00
|
|
|
# N530 direct neutron imports not allowed
|
2018-04-30 16:35:52 -04:00
|
|
|
# TODO(ihrachys) figure out what to do with N534
|
2017-04-12 16:43:44 -07:00
|
|
|
# N534 Untranslated exception message
|
2018-04-11 00:47:20 +09:00
|
|
|
# TODO(amotoki) check the following new rules should be fixed or ignored
|
|
|
|
# E731 do not assign a lambda expression, use a def
|
2018-06-20 16:04:28 +09:00
|
|
|
# W504 line break after binary operator
|
|
|
|
ignore = E125,E126,E128,E731,H404,H405,N530,N534,W504
|
2017-07-18 17:04:06 +09:00
|
|
|
# H106: Don't put vim configuration in source files
|
2017-06-22 16:52:29 +08:00
|
|
|
# H203: Use assertIs(Not)None to check for None
|
2018-01-29 15:35:38 +07:00
|
|
|
# H204: Use assert(Not)Equal to check for equality
|
|
|
|
# H205: Use assert(Greater|Less)(Equal) for comparison
|
2016-11-07 18:48:23 +00:00
|
|
|
# H904: Delay string interpolations at logging calls
|
2018-01-29 15:35:38 +07:00
|
|
|
enable-extensions=H106,H203,H204,H205,H904
|
2013-05-17 02:18:56 +00:00
|
|
|
show-source = true
|
2017-04-12 16:43:44 -07:00
|
|
|
exclude = ./.*,build,dist,doc
|
2017-07-02 11:07:42 +00:00
|
|
|
import-order-style = pep8
|
2014-05-01 06:10:57 -07:00
|
|
|
|
|
|
|
[hacking]
|
2016-01-26 10:52:47 +09:00
|
|
|
import_exceptions = neutron._i18n
|
2014-05-01 06:10:57 -07:00
|
|
|
local-check-factory = neutron.hacking.checks.factory
|
2015-11-09 23:37:37 +00:00
|
|
|
|
2017-07-28 17:49:28 -07:00
|
|
|
[testenv:bandit]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2017-07-28 17:50:41 -07:00
|
|
|
# B104: Possible binding to all interfaces
|
|
|
|
# B111: Execute with run_as_root=True identified, possible security issue
|
|
|
|
# B311: Standard pseudo-random generators are not suitable for security/cryptographic purpose
|
2017-07-28 17:49:28 -07:00
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2018-04-24 17:04:15 +04:00
|
|
|
commands = bandit -r neutron -x tests -n5 -s B104,B111,B311
|
2017-07-28 17:49:28 -07:00
|
|
|
|
2017-01-31 16:52:42 -06:00
|
|
|
[testenv:bashate]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2017-01-31 16:52:42 -06:00
|
|
|
commands = bash -c "find {toxinidir} \
|
|
|
|
-not \( -type d -name .tox\* -prune \) \
|
|
|
|
-not \( -type d -name .venv\* -prune \) \
|
|
|
|
-type f \
|
|
|
|
-name \*.sh \
|
|
|
|
# E005 file does not begin with #! or have a .sh prefix
|
|
|
|
# E006 check for lines longer than 79 columns
|
|
|
|
# E042 local declaration hides errors
|
2017-03-07 13:16:01 -05:00
|
|
|
# E043 Arithmetic compound has inconsistent return semantics
|
|
|
|
-print0 | xargs -0 bashate -v -iE006 -eE005,E042,E043"
|
2017-01-31 16:52:42 -06:00
|
|
|
|
2015-11-09 23:37:37 +00:00
|
|
|
[testenv:genconfig]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2015-11-09 23:37:37 +00:00
|
|
|
commands = {toxinidir}/tools/generate_config_file_samples.sh
|
2016-09-26 07:37:31 +00:00
|
|
|
|
|
|
|
# This environment can be used to quickly validate that all needed system
|
|
|
|
# packages required to successfully execute test targets are installed
|
|
|
|
[testenv:bindep]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2016-09-26 07:37:31 +00:00
|
|
|
# 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
|
2018-03-22 16:27:44 -04:00
|
|
|
|
|
|
|
[testenv:lower-constraints]
|
|
|
|
basepython = python3
|
2018-04-26 11:45:18 -04:00
|
|
|
setenv = OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:60}
|
2018-03-22 16:27:44 -04:00
|
|
|
deps =
|
|
|
|
-c{toxinidir}/lower-constraints.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-r{toxinidir}/requirements.txt
|