2014-09-09 17:34:53 +05:30
|
|
|
|
[tox]
|
2021-06-24 16:01:54 +00:00
|
|
|
|
minversion = 3.18
|
2019-10-28 17:42:27 +01:00
|
|
|
|
envlist = py37,pep8
|
2014-09-09 17:34:53 +05:30
|
|
|
|
skipsdist = True
|
2021-06-24 16:01:54 +00:00
|
|
|
|
ignore_basepython_conflict = True
|
2014-09-09 17:34:53 +05:30
|
|
|
|
|
|
|
|
|
[testenv]
|
2019-10-28 17:42:27 +01:00
|
|
|
|
basepython = python3
|
2014-09-09 17:34:53 +05:30
|
|
|
|
usedevelop = True
|
2015-11-03 17:28:04 +08:00
|
|
|
|
whitelist_externals = bash
|
|
|
|
|
find
|
2016-03-29 15:05:57 +08:00
|
|
|
|
rm
|
2014-09-09 17:34:53 +05:30
|
|
|
|
setenv =
|
|
|
|
|
VIRTUAL_ENV={envdir}
|
2016-10-26 13:17:13 +05:30
|
|
|
|
PYTHONWARNINGS=default::DeprecationWarning
|
2019-09-30 15:26:21 +00:00
|
|
|
|
OS_STDOUT_CAPTURE=1
|
|
|
|
|
OS_STDERR_CAPTURE=1
|
2020-12-16 11:55:28 +13:00
|
|
|
|
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
|
-r{toxinidir}/requirements.txt
|
2014-09-09 17:34:53 +05:30
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2016-01-22 13:03:54 -05:00
|
|
|
|
passenv = TEMPEST_* OS_TEST_*
|
2015-09-06 11:36:16 +08:00
|
|
|
|
commands =
|
2016-09-16 09:25:15 +05:30
|
|
|
|
find . -type f -name "*.py[c|o]" -delete
|
2017-04-03 09:51:46 +00:00
|
|
|
|
rm -f .testrepository/times.dbm
|
2018-07-12 15:52:48 +07:00
|
|
|
|
stestr run {posargs}
|
2014-09-09 17:34:53 +05:30
|
|
|
|
|
2016-01-10 00:42:39 +08:00
|
|
|
|
[testenv:debug]
|
2017-03-09 22:40:27 +07:00
|
|
|
|
commands = oslo_debug_helper -t magnum/tests/unit {posargs}
|
2017-01-19 18:49:43 +08:00
|
|
|
|
|
2015-11-04 15:22:14 +08:00
|
|
|
|
[testenv:functional-k8s]
|
|
|
|
|
sitepackages = True
|
2016-08-27 19:52:02 +05:30
|
|
|
|
setenv = {[testenv]setenv}
|
|
|
|
|
OS_TEST_PATH=./magnum/tests/functional/k8s
|
2015-04-14 17:28:14 -04:00
|
|
|
|
OS_TEST_TIMEOUT=7200
|
2015-04-05 21:12:56 -04:00
|
|
|
|
deps =
|
|
|
|
|
{[testenv]deps}
|
2015-11-03 17:28:04 +08:00
|
|
|
|
commands =
|
2016-09-16 09:25:15 +05:30
|
|
|
|
find . -type f -name "*.py[c|o]" -delete
|
2018-07-12 15:52:48 +07:00
|
|
|
|
stestr run {posargs}
|
2015-04-05 21:12:56 -04:00
|
|
|
|
|
2016-07-14 21:25:36 +02:00
|
|
|
|
[testenv:functional-k8s-ironic]
|
|
|
|
|
sitepackages = True
|
2016-08-27 19:52:02 +05:30
|
|
|
|
setenv = {[testenv]setenv}
|
|
|
|
|
OS_TEST_PATH=./magnum/tests/functional/k8s_ironic
|
2016-07-14 21:25:36 +02:00
|
|
|
|
OS_TEST_TIMEOUT=7200
|
|
|
|
|
deps =
|
|
|
|
|
{[testenv]deps}
|
|
|
|
|
commands =
|
2016-09-16 09:25:15 +05:30
|
|
|
|
find . -type f -name "*.py[c|o]" -delete
|
2018-07-12 15:52:48 +07:00
|
|
|
|
stestr run {posargs}
|
2016-07-14 21:25:36 +02:00
|
|
|
|
|
2016-02-28 18:21:08 -05:00
|
|
|
|
[testenv:functional-k8s-coreos]
|
|
|
|
|
sitepackages = True
|
2016-08-27 19:52:02 +05:30
|
|
|
|
setenv = {[testenv]setenv}
|
|
|
|
|
OS_TEST_PATH=./magnum/tests/functional/k8s_coreos
|
2016-02-28 18:21:08 -05:00
|
|
|
|
OS_TEST_TIMEOUT=7200
|
|
|
|
|
deps =
|
|
|
|
|
{[testenv]deps}
|
|
|
|
|
commands =
|
2016-09-16 09:25:15 +05:30
|
|
|
|
find . -type f -name "*.py[c|o]" -delete
|
2018-07-12 15:52:48 +07:00
|
|
|
|
stestr run {posargs}
|
2016-02-28 18:21:08 -05:00
|
|
|
|
|
2015-11-12 09:45:49 +08:00
|
|
|
|
[testenv:functional-swarm]
|
|
|
|
|
sitepackages = True
|
2016-08-27 19:52:02 +05:30
|
|
|
|
setenv = {[testenv]setenv}
|
|
|
|
|
OS_TEST_PATH=./magnum/tests/functional/swarm
|
2015-11-12 09:45:49 +08:00
|
|
|
|
OS_TEST_TIMEOUT=7200
|
|
|
|
|
deps =
|
|
|
|
|
{[testenv]deps}
|
|
|
|
|
commands =
|
2016-09-16 09:25:15 +05:30
|
|
|
|
find . -type f -name "*.py[c|o]" -delete
|
2018-07-12 15:52:48 +07:00
|
|
|
|
stestr run {posargs}
|
2015-11-12 09:45:49 +08:00
|
|
|
|
|
2017-02-01 10:03:42 +01:00
|
|
|
|
[testenv:functional-swarm-mode]
|
|
|
|
|
sitepackages = True
|
|
|
|
|
setenv = {[testenv]setenv}
|
|
|
|
|
OS_TEST_PATH=./magnum/tests/functional/swarm_mode
|
|
|
|
|
OS_TEST_TIMEOUT=7200
|
|
|
|
|
deps =
|
|
|
|
|
{[testenv]deps}
|
|
|
|
|
commands =
|
|
|
|
|
find . -type f -name "*.py[c|o]" -delete
|
2018-07-12 15:52:48 +07:00
|
|
|
|
stestr run {posargs}
|
2017-02-01 10:03:42 +01:00
|
|
|
|
|
2015-12-28 13:16:14 +08:00
|
|
|
|
[testenv:functional-mesos]
|
|
|
|
|
sitepackages = True
|
2016-08-27 19:52:02 +05:30
|
|
|
|
setenv = {[testenv]setenv}
|
|
|
|
|
OS_TEST_PATH=./magnum/tests/functional/mesos
|
2015-12-28 13:16:14 +08:00
|
|
|
|
OS_TEST_TIMEOUT=7200
|
|
|
|
|
deps =
|
|
|
|
|
{[testenv]deps}
|
|
|
|
|
commands =
|
2016-09-16 09:25:15 +05:30
|
|
|
|
find . -type f -name "*.py[c|o]" -delete
|
2018-07-12 15:52:48 +07:00
|
|
|
|
stestr run {posargs}
|
2015-12-28 13:16:14 +08:00
|
|
|
|
|
2022-05-27 12:43:22 +10:00
|
|
|
|
[testenv:pep8]
|
|
|
|
|
commands =
|
|
|
|
|
doc8 -e .rst specs/ doc/source/ contrib/ CONTRIBUTING.rst HACKING.rst README.rst
|
|
|
|
|
bash tools/flake8wrap.sh {posargs}
|
|
|
|
|
bandit -r magnum -x tests -n5 -ll
|
|
|
|
|
bash -c "find {toxinidir} \
|
|
|
|
|
-not \( -type d -name .?\* -prune \) \
|
|
|
|
|
-not \( -type d -name doc -prune \) \
|
|
|
|
|
-not \( -type d -name contrib -prune \) \
|
|
|
|
|
-type f \
|
|
|
|
|
-name \*.sh \
|
|
|
|
|
-print0 | xargs -0 bashate -v -iE006,E010,E042 -eE005"
|
|
|
|
|
|
2014-09-09 17:34:53 +05:30
|
|
|
|
[testenv:venv]
|
|
|
|
|
commands = {posargs}
|
|
|
|
|
|
2015-04-08 10:18:24 -07:00
|
|
|
|
[testenv:bandit]
|
2015-11-16 19:04:31 -06:00
|
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2016-03-09 10:15:26 -08:00
|
|
|
|
commands = bandit -r magnum -x tests -n5 -ll
|
2015-04-08 10:18:24 -07:00
|
|
|
|
|
2014-09-09 17:34:53 +05:30
|
|
|
|
[testenv:cover]
|
2020-06-30 14:21:39 +00:00
|
|
|
|
setenv =
|
|
|
|
|
{[testenv]setenv}
|
|
|
|
|
PYTHON=coverage run --source magnum --parallel-mode
|
2017-03-20 19:52:08 +08:00
|
|
|
|
commands = {toxinidir}/tools/cover.sh {posargs}
|
2014-09-09 17:34:53 +05:30
|
|
|
|
|
|
|
|
|
[testenv:docs]
|
2021-06-24 16:01:54 +00:00
|
|
|
|
deps =
|
|
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
|
|
|
|
commands =
|
|
|
|
|
rm -rf doc/build/html doc/build/doctrees
|
|
|
|
|
sphinx-build -W --keep-going -b html -j auto doc/source doc/build/html
|
2014-09-09 17:34:53 +05:30
|
|
|
|
|
2019-09-24 15:59:12 -07:00
|
|
|
|
[testenv:pdf-docs]
|
|
|
|
|
deps = {[testenv:docs]deps}
|
|
|
|
|
commands =
|
2021-06-24 16:01:54 +00:00
|
|
|
|
rm -rf doc/build/pdf
|
|
|
|
|
sphinx-build -W --keep-going -b latex -j auto doc/source doc/build/pdf
|
2019-09-24 15:59:12 -07:00
|
|
|
|
make -C doc/build/pdf
|
|
|
|
|
|
2014-11-24 12:23:11 -08:00
|
|
|
|
[testenv:genconfig]
|
|
|
|
|
commands =
|
2016-01-27 09:59:15 +08:00
|
|
|
|
oslo-config-generator --config-file etc/magnum/magnum-config-generator.conf
|
2014-11-24 12:23:11 -08:00
|
|
|
|
|
2017-10-03 17:48:56 +07:00
|
|
|
|
[testenv:genpolicy]
|
|
|
|
|
commands =
|
|
|
|
|
oslopolicy-sample-generator --config-file etc/magnum/magnum-policy-generator.conf
|
|
|
|
|
|
2014-09-09 17:34:53 +05:30
|
|
|
|
[flake8]
|
2017-06-22 16:35:33 +08:00
|
|
|
|
# H106 Don’t put vim configuration in source files
|
|
|
|
|
# H203 Use assertIs(Not)None to check for None
|
2017-07-08 09:32:37 +08:00
|
|
|
|
# H904 Delay string interpolations at logging calls
|
2017-11-18 01:27:34 -08:00
|
|
|
|
filename = *.py,app.wsgi
|
2017-07-08 09:32:37 +08:00
|
|
|
|
enable-extensions = H106,H203,H904
|
2017-01-17 09:23:40 +07:00
|
|
|
|
exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,tools,releasenotes
|
2015-05-15 20:10:49 -04:00
|
|
|
|
|
2020-03-31 17:18:42 +02:00
|
|
|
|
[flake8:local-plugins]
|
|
|
|
|
extension =
|
|
|
|
|
M302 = checks:assert_equal_not_none
|
|
|
|
|
M310 = checks:use_timeutils_utcnow
|
|
|
|
|
M316 = checks:assert_true_isinstance
|
|
|
|
|
M322 = checks:no_mutable_default_args
|
|
|
|
|
M336 = checks:dict_constructor_with_list_copy
|
|
|
|
|
M338 = checks:assert_equal_in
|
|
|
|
|
M339 = checks:no_xrange
|
|
|
|
|
M340 = checks:check_explicit_underscore_import
|
|
|
|
|
M352 = checks:no_log_warn
|
|
|
|
|
paths = ./magnum/hacking
|
2015-06-16 16:34:05 +08:00
|
|
|
|
|
2017-11-26 12:38:59 +05:30
|
|
|
|
[testenv:pip-check-reqs]
|
2015-05-15 20:10:49 -04:00
|
|
|
|
# do not install test-requirements as that will pollute the virtualenv for
|
|
|
|
|
# determining missing packages
|
2017-11-26 12:38:59 +05:30
|
|
|
|
# this also means that pip_check_reqs must be installed separately, outside
|
2015-05-15 20:10:49 -04:00
|
|
|
|
# of the requirements.txt files
|
2017-11-26 12:38:59 +05:30
|
|
|
|
deps = pip_check_reqs
|
2015-05-15 20:10:49 -04:00
|
|
|
|
-rrequirements.txt
|
|
|
|
|
commands=pip-missing-reqs -d --ignore-file=magnum/tests/* magnum
|
2016-03-29 15:05:57 +08:00
|
|
|
|
|
|
|
|
|
[testenv:releasenotes]
|
2018-03-22 18:09:40 +09:00
|
|
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
2016-03-29 15:05:57 +08:00
|
|
|
|
commands =
|
|
|
|
|
rm -rf releasenotes/build
|
2019-10-24 13:32:54 +08:00
|
|
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
|
2016-06-14 14:09:56 +02:00
|
|
|
|
|
|
|
|
|
[testenv:install-guide]
|
2019-10-24 13:32:54 +08:00
|
|
|
|
commands = sphinx-build -a -E -W -d install-guide/build/doctrees --keep-going -b html install-guide/source install-guide/build/html
|
2016-08-18 23:23:03 +07:00
|
|
|
|
|
|
|
|
|
[testenv:api-ref]
|
2018-03-22 18:09:40 +09:00
|
|
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
2016-08-18 23:23:03 +07:00
|
|
|
|
commands =
|
|
|
|
|
rm -rf api-ref/build
|
2019-10-24 13:32:54 +08:00
|
|
|
|
sphinx-build -W --keep-going -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
|
2018-03-22 15:12:42 -04:00
|
|
|
|
|
2018-04-20 14:15:53 -04:00
|
|
|
|
# This environment can be used to quickly validate that all needed system
|
|
|
|
|
# packages required to successfully execute test targets are installed
|
|
|
|
|
[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
|