2014-06-25 02:58:49 -07:00
|
|
|
[tox]
|
2019-04-15 06:43:57 -07:00
|
|
|
minversion = 2.5.0
|
2019-08-06 17:13:45 -07:00
|
|
|
envlist = docs,py27,py36,py37,functional-py37,functional-py36,functional,pep8,specs
|
2014-06-25 02:58:49 -07:00
|
|
|
skipsdist = True
|
|
|
|
|
|
|
|
[testenv]
|
|
|
|
usedevelop = True
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
2016-08-09 19:00:22 -04:00
|
|
|
PYTHONWARNINGS=default::DeprecationWarning
|
2016-06-01 13:56:08 +02:00
|
|
|
install_command =
|
2019-06-11 13:49:37 +08:00
|
|
|
pip install {opts} {packages}
|
2015-03-31 11:18:31 -05:00
|
|
|
whitelist_externals = find
|
2019-06-11 13:49:37 +08:00
|
|
|
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2014-06-25 02:58:49 -07:00
|
|
|
-r{toxinidir}/test-requirements.txt
|
2015-03-31 11:18:31 -05:00
|
|
|
commands =
|
2018-10-09 10:17:28 +07:00
|
|
|
stestr run {posargs}
|
2018-03-06 16:37:49 +01:00
|
|
|
stestr slowest
|
2014-06-25 02:58:49 -07:00
|
|
|
|
2017-02-10 14:04:20 -08:00
|
|
|
[testenv:api-ref]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2017-02-10 14:04:20 -08:00
|
|
|
# This environment is called from CI scripts to test and publish
|
2019-07-22 18:49:27 +02:00
|
|
|
# the API Ref to docs.openstack.org.
|
2018-01-23 09:55:36 -08:00
|
|
|
deps =
|
2019-06-11 13:49:37 +08:00
|
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2018-01-23 09:55:36 -08:00
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2017-02-10 14:04:20 -08:00
|
|
|
whitelist_externals = rm
|
|
|
|
commands =
|
|
|
|
rm -rf api-ref/build
|
|
|
|
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
|
|
|
|
|
2015-03-27 16:10:59 +00:00
|
|
|
[testenv:cover]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2016-10-04 17:22:38 +00:00
|
|
|
whitelist_externals = sh
|
2018-03-11 18:49:09 +01:00
|
|
|
setenv =
|
|
|
|
{[testenv]setenv}
|
|
|
|
PYTHON=coverage run --source octavia --parallel-mode
|
2016-10-04 17:22:38 +00:00
|
|
|
commands =
|
2017-04-18 15:28:10 -07:00
|
|
|
coverage erase
|
2018-03-11 18:49:09 +01:00
|
|
|
sh -c 'OS_TEST_PATH={toxinidir}/octavia/tests/unit stestr run {posargs}'
|
|
|
|
sh -c 'OS_TEST_PATH={toxinidir}/octavia/tests/functional stestr run {posargs}'
|
|
|
|
coverage combine
|
2017-04-23 11:12:50 -07:00
|
|
|
# Generate a new HTML report with the combined results
|
|
|
|
# otherwise the HTML report will only show partial results
|
|
|
|
coverage html -d cover
|
2018-05-23 10:05:50 -07:00
|
|
|
coverage xml -o cover/coverage.xml
|
2018-09-06 16:39:20 -07:00
|
|
|
coverage report --fail-under=90 --skip-covered
|
2015-03-27 16:10:59 +00:00
|
|
|
|
2015-04-09 15:25:25 -05:00
|
|
|
[testenv:functional]
|
2019-06-12 15:32:03 -07:00
|
|
|
# This is set as py27 right now, though the name is ambiguous.
|
|
|
|
basepython = python2.7
|
|
|
|
setenv = OS_TEST_PATH={toxinidir}/octavia/tests/functional
|
|
|
|
|
|
|
|
[testenv:functional-py27]
|
|
|
|
basepython = python2.7
|
2015-04-09 15:25:25 -05:00
|
|
|
setenv = OS_TEST_PATH={toxinidir}/octavia/tests/functional
|
|
|
|
|
2019-02-08 23:38:38 +01:00
|
|
|
[testenv:functional-py36]
|
|
|
|
basepython = python3.6
|
|
|
|
setenv = OS_TEST_PATH={toxinidir}/octavia/tests/functional
|
|
|
|
|
2019-02-06 19:42:28 +01:00
|
|
|
[testenv:functional-py37]
|
|
|
|
basepython = python3.7
|
|
|
|
setenv = OS_TEST_PATH={toxinidir}/octavia/tests/functional
|
|
|
|
|
2016-01-13 13:12:37 +08:00
|
|
|
[testenv:debug]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2016-01-13 13:12:37 +08:00
|
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
|
|
|
|
[testenv:debug-py27]
|
|
|
|
basepython = python2.7
|
|
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
|
2014-06-25 02:58:49 -07:00
|
|
|
[testenv:pep8]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2014-06-25 02:58:49 -07:00
|
|
|
commands = flake8
|
2017-12-07 16:26:39 -08:00
|
|
|
# RST linter
|
|
|
|
doc8 --ignore-path doc/source/contributor/modules specs \
|
|
|
|
doc/source octavia CONSTITUTION.rst HACKING.rst README.rst \
|
|
|
|
TESTING.rst
|
|
|
|
# Run security linter
|
2019-10-10 14:01:40 -04:00
|
|
|
{[testenv:bandit]commands}
|
2016-12-15 00:46:17 +00:00
|
|
|
# Make sure specs follow our template
|
2016-09-08 18:11:36 -07:00
|
|
|
find . -type f -name "*.pyc" -delete
|
|
|
|
python -m unittest specs-tests.test_titles
|
2016-12-15 00:46:17 +00:00
|
|
|
sh ./tools/misc-sanity-checks.sh
|
2018-10-09 10:17:28 +07:00
|
|
|
{toxinidir}/tools/coding-checks.sh --pylint {posargs}
|
2019-10-10 13:54:58 -04:00
|
|
|
{[testenv:bashate]commands}
|
2016-12-15 00:46:17 +00:00
|
|
|
whitelist_externals =
|
|
|
|
sh
|
|
|
|
find
|
2019-10-10 13:54:58 -04:00
|
|
|
bash
|
2014-06-25 02:58:49 -07:00
|
|
|
|
|
|
|
[testenv:docs]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2017-11-17 18:20:33 -06:00
|
|
|
deps =
|
2019-06-11 13:49:37 +08:00
|
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2017-11-17 18:20:33 -06:00
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2017-02-10 14:04:20 -08:00
|
|
|
whitelist_externals = rm
|
2016-03-24 18:03:27 +00:00
|
|
|
commands =
|
2018-01-17 22:06:00 +08:00
|
|
|
rm -rf doc/build api-guide/build api-ref/build doc/source/contributor/modules
|
2017-11-17 18:20:33 -06:00
|
|
|
sphinx-build -W -b html doc/source doc/build/html
|
2017-02-10 14:04:20 -08:00
|
|
|
sphinx-build -W -b html api-ref/source api-ref/build/html
|
2014-06-25 02:58:49 -07:00
|
|
|
|
2019-06-24 16:45:13 -07:00
|
|
|
[testenv:pdf-docs]
|
|
|
|
basepython = python3
|
|
|
|
deps = {[testenv:docs]deps}
|
|
|
|
whitelist_externals =
|
|
|
|
make
|
|
|
|
rm
|
|
|
|
commands =
|
|
|
|
rm -rf doc/build/pdf
|
|
|
|
sphinx-build -W -b latex doc/source doc/build/pdf
|
|
|
|
make -C doc/build/pdf
|
|
|
|
|
2015-09-30 16:31:55 +00:00
|
|
|
[testenv:venv]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2015-09-30 16:31:55 +00:00
|
|
|
commands = {posargs}
|
|
|
|
|
2015-08-25 17:36:27 +02:00
|
|
|
[testenv:genconfig]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2017-03-25 17:21:13 +08:00
|
|
|
whitelist_externals = mkdir
|
2015-08-25 17:36:27 +02:00
|
|
|
commands =
|
2017-03-25 17:21:13 +08:00
|
|
|
mkdir -p etc/octavia
|
2015-08-25 17:36:27 +02:00
|
|
|
oslo-config-generator --output-file etc/octavia/octavia.conf.sample \
|
|
|
|
--namespace octavia \
|
|
|
|
--namespace oslo.db \
|
|
|
|
--namespace oslo.log \
|
|
|
|
--namespace oslo.messaging \
|
|
|
|
--namespace keystonemiddleware.auth_token
|
|
|
|
|
2017-06-09 18:53:18 -07:00
|
|
|
[testenv:genpolicy]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2017-06-09 18:53:18 -07:00
|
|
|
whitelist_externals = mkdir
|
|
|
|
commands =
|
|
|
|
mkdir -p etc/octavia
|
|
|
|
oslopolicy-sample-generator \
|
2018-07-23 13:16:49 -07:00
|
|
|
--config-file etc/policy/octavia-policy-generator.conf
|
2017-06-09 18:53:18 -07:00
|
|
|
|
2015-04-17 11:46:44 -05:00
|
|
|
[testenv:specs]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2017-06-20 09:36:12 -07:00
|
|
|
whitelist_externals =
|
|
|
|
rm
|
|
|
|
find
|
2015-04-17 11:46:44 -05:00
|
|
|
commands =
|
|
|
|
find . -type f -name "*.pyc" -delete
|
|
|
|
python -m unittest specs-tests.test_titles
|
|
|
|
|
2016-03-01 15:23:51 -08:00
|
|
|
|
|
|
|
[testenv:bandit]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2019-10-10 14:01:40 -04:00
|
|
|
commands = bandit -r octavia -ll -ii -x tests
|
2016-03-01 15:23:51 -08:00
|
|
|
|
2014-06-25 02:58:49 -07:00
|
|
|
[flake8]
|
2019-09-09 17:02:45 -07:00
|
|
|
# [H104]: Empty file with only comments
|
|
|
|
# [W504]: Line break after binary operator
|
|
|
|
ignore = H104,W504
|
2014-06-25 02:58:49 -07:00
|
|
|
show-source = true
|
2014-08-28 23:38:38 -07:00
|
|
|
builtins = _
|
2016-06-06 06:13:43 -07:00
|
|
|
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
2017-09-14 11:56:55 +03:00
|
|
|
import-order-style = pep8
|
2018-02-05 18:37:03 +08:00
|
|
|
# [H106]: Don't put vim configuration in source files
|
2017-11-22 16:52:15 +08:00
|
|
|
# [H203]: Use assertIs(Not)None to check for None
|
2018-02-01 10:07:12 +07:00
|
|
|
# [H204]: Use assert(Not)Equal to check for equality
|
|
|
|
# [H205]: Use assert(Greater|Less)(Equal) for comparison
|
2019-09-09 17:02:45 -07:00
|
|
|
# [H904]: Delay string interpolations at logging calls
|
2018-02-01 10:07:12 +07:00
|
|
|
enable-extensions=H106,H203,H204,H205,H904
|
2014-07-30 00:59:02 -07:00
|
|
|
|
2019-10-10 13:54:58 -04:00
|
|
|
[testenv:bashate]
|
|
|
|
basepython = python3
|
|
|
|
envdir = {toxworkdir}/shared
|
|
|
|
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
|
|
|
|
# [E043]: Arithmetic compound has inconsistent return semantics
|
|
|
|
-print0 | xargs -0 bashate -v -iE006 -eE005,E042,E043"
|
|
|
|
|
2014-12-01 22:05:29 -07:00
|
|
|
[hacking]
|
|
|
|
import_exceptions = octavia.i18n
|
|
|
|
local-check-factory = octavia.hacking.checks.factory
|
|
|
|
|
2014-07-30 00:59:02 -07:00
|
|
|
[doc8]
|
|
|
|
max-line-length = 79
|
2015-12-04 13:14:06 -06:00
|
|
|
|
|
|
|
[testenv:releasenotes]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2018-02-07 09:20:31 -08:00
|
|
|
deps =
|
2019-06-11 13:49:37 +08:00
|
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2018-02-07 09:20:31 -08:00
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2018-05-22 18:44:04 +08:00
|
|
|
whitelist_externals = rm
|
|
|
|
commands =
|
|
|
|
rm -rf releasenotes/build
|
|
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
2015-04-09 15:25:25 -05:00
|
|
|
|
2018-03-22 16:43:37 -04:00
|
|
|
[testenv:lower-constraints]
|
|
|
|
basepython = python3
|
|
|
|
deps =
|
|
|
|
-c{toxinidir}/lower-constraints.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-r{toxinidir}/requirements.txt
|
2018-03-28 17:05:20 -07:00
|
|
|
whitelist_externals = sh
|
|
|
|
commands =
|
|
|
|
sh -c 'OS_TEST_PATH={toxinidir}/octavia/tests/unit stestr run {posargs}'
|
|
|
|
sh -c 'OS_TEST_PATH={toxinidir}/octavia/tests/functional stestr run {posargs}'
|
2018-05-31 11:25:20 -07:00
|
|
|
|
|
|
|
[testenv:requirements]
|
2018-06-06 16:06:03 -04:00
|
|
|
basepython = python3
|
2018-05-31 11:25:20 -07:00
|
|
|
deps =
|
2019-04-23 19:39:00 +08:00
|
|
|
-egit+https://opendev.org/openstack/requirements#egg=openstack-requirements
|
2018-05-31 11:25:20 -07:00
|
|
|
whitelist_externals = sh
|
|
|
|
commands =
|
|
|
|
sh -c '{envdir}/src/openstack-requirements/playbooks/files/project-requirements-change.py --req {envdir}/src/openstack-requirements --local {toxinidir} master'
|