2014-10-03 09:26:36 +00:00
|
|
|
[tox]
|
2021-05-18 19:52:33 +08:00
|
|
|
minversion = 3.18
|
2020-09-17 19:27:54 +08:00
|
|
|
envlist = py38,linters
|
2020-02-29 15:03:08 -06:00
|
|
|
ignore_basepython_conflict = True
|
2014-10-03 09:26:36 +00:00
|
|
|
|
|
|
|
[testenv]
|
2019-11-20 11:47:46 +01:00
|
|
|
basepython = python3
|
2019-11-18 14:04:40 +00:00
|
|
|
usedevelop = True
|
2022-12-09 10:10:07 +00:00
|
|
|
allowlist_externals = bash
|
|
|
|
find
|
2016-03-22 17:11:28 -07:00
|
|
|
rm
|
2020-10-30 09:55:45 +08:00
|
|
|
deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2018-04-06 18:28:51 +09:00
|
|
|
-r{toxinidir}/requirements.txt
|
2015-07-10 14:13:47 -07:00
|
|
|
-r{toxinidir}/test-requirements.txt
|
2022-12-09 10:10:07 +00:00
|
|
|
passenv = http_proxy,HTTP_PROXY,https_proxy,HTTPS_PROXY,no_proxy,NO_PROXY, \
|
|
|
|
OS_STDOUT_CAPTURE,OS_STDERR_CAPTURE,OS_LOG_CAPTURE,OS_TEST_TIMEOUT, \
|
|
|
|
PYTHON,OS_TEST_PATH,LISTOPT,IDOPTION
|
2016-01-08 19:18:56 +08:00
|
|
|
commands =
|
2019-02-13 21:30:51 +01:00
|
|
|
find . -type f -name "*.py[c|o]" -delete -o -type l -name "*.py[c|o]" -delete
|
2016-09-20 12:09:30 +05:30
|
|
|
find . -type d -name "__pycache__" -delete
|
2022-12-09 10:10:07 +00:00
|
|
|
bash {toxinidir}/tests/link-module-utils.sh {toxinidir} {envsitepackagesdir}
|
2018-07-10 17:44:27 +07:00
|
|
|
stestr run --slowest {posargs}
|
2014-10-03 09:26:36 +00:00
|
|
|
|
2016-09-20 17:48:05 +05:30
|
|
|
[testenv:debug]
|
2017-07-06 13:41:30 +01:00
|
|
|
commands = oslo_debug_helper -t tests {posargs}
|
2016-09-20 17:48:05 +05:30
|
|
|
|
2017-01-12 18:15:04 +05:30
|
|
|
[testenv:cover]
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
|
|
NOSE_WITH_COVERAGE=1
|
|
|
|
NOSE_COVER_BRANCHES=1
|
|
|
|
NOSE_COVER_HTML=1
|
|
|
|
NOSE_COVER_HTML_DIR={toxinidir}/cover
|
2021-11-04 17:29:16 +01:00
|
|
|
PYTHON=coverage run --source kolla_ansible,ansible/action_plugins,ansible/library,ansible/module_utils,ansible/roles/keystone/files/ --parallel-mode
|
2018-07-10 17:44:27 +07:00
|
|
|
commands =
|
2022-12-09 10:10:07 +00:00
|
|
|
bash {toxinidir}/tests/link-module-utils.sh {toxinidir} {envsitepackagesdir}
|
2019-11-18 14:04:40 +00:00
|
|
|
stestr run {posargs}
|
|
|
|
coverage combine
|
|
|
|
coverage html -d cover
|
|
|
|
coverage xml -o cover/coverage.xml
|
2023-01-23 14:14:07 +01:00
|
|
|
coverage report --show-missing
|
2016-03-08 11:50:37 -05:00
|
|
|
|
2015-09-03 00:15:54 +00:00
|
|
|
[testenv:venv]
|
2018-04-06 18:28:51 +09:00
|
|
|
deps =
|
2020-10-30 09:55:45 +08:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2022-09-29 16:37:39 +02:00
|
|
|
-r{toxinidir}/requirements.txt
|
2018-04-06 18:28:51 +09:00
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2015-09-03 00:15:54 +00:00
|
|
|
commands = {posargs}
|
|
|
|
|
2015-08-28 01:38:42 +00:00
|
|
|
[testenv:docs]
|
2020-10-22 14:14:12 +02:00
|
|
|
skip_install = true
|
2018-04-06 18:28:51 +09:00
|
|
|
deps =
|
2021-05-19 11:50:59 +08:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2016-08-04 15:09:10 +02:00
|
|
|
commands =
|
2020-10-22 14:14:12 +02:00
|
|
|
rm -rf doc/build/html
|
2021-08-31 18:31:40 +00:00
|
|
|
{[testenv:docs-iterative]commands}
|
|
|
|
|
|
|
|
[testenv:docs-iterative]
|
|
|
|
envdir = {toxworkdir}/docs
|
|
|
|
skip_install = {[testenv:docs]skip_install}
|
|
|
|
deps = {[testenv:docs]deps}
|
|
|
|
commands =
|
2020-10-22 14:14:12 +02:00
|
|
|
sphinx-build -n -W --keep-going -b html doc/source doc/build/html
|
2020-09-17 17:47:55 +01:00
|
|
|
whereto doc/source/_extra/.htaccess doc/test/redirect-tests.txt
|
2015-08-28 01:38:42 +00:00
|
|
|
|
2017-01-27 16:55:04 +10:00
|
|
|
[testenv:deploy-guide]
|
2020-10-22 14:14:12 +02:00
|
|
|
skip_install = {[testenv:docs]skip_install}
|
2020-09-09 23:45:53 +08:00
|
|
|
deps = {[testenv:docs]deps}
|
2018-04-06 18:28:51 +09:00
|
|
|
commands =
|
2020-10-22 14:14:12 +02:00
|
|
|
rm -rf deploy-guide/build/html
|
|
|
|
sphinx-build -n -W --keep-going -b html deploy-guide/source deploy-guide/build/html
|
2017-01-27 16:55:04 +10:00
|
|
|
|
2019-09-17 11:50:41 +01:00
|
|
|
[testenv:pdf-docs]
|
2021-05-18 19:52:33 +08:00
|
|
|
allowlist_externals = make
|
2022-12-09 10:10:07 +00:00
|
|
|
rm
|
2020-10-22 14:14:12 +02:00
|
|
|
skip_install = {[testenv:docs]skip_install}
|
2019-09-17 11:50:41 +01:00
|
|
|
deps = {[testenv:docs]deps}
|
|
|
|
commands =
|
2020-10-22 14:14:12 +02:00
|
|
|
rm -rf doc/build/pdf
|
|
|
|
sphinx-build -n -W --keep-going -b latex doc/source doc/build/pdf
|
2019-09-17 11:50:41 +01:00
|
|
|
make -C doc/build/pdf
|
|
|
|
|
2016-03-22 17:11:28 -07:00
|
|
|
[testenv:releasenotes]
|
2020-10-22 14:14:12 +02:00
|
|
|
skip_install = {[testenv:docs]skip_install}
|
2020-09-09 23:45:53 +08:00
|
|
|
deps = {[testenv:docs]deps}
|
2016-03-22 17:11:28 -07:00
|
|
|
commands =
|
2020-10-22 14:14:12 +02:00
|
|
|
rm -rf releasenotes/build/html
|
|
|
|
sphinx-build -n -W --keep-going -b html releasenotes/source releasenotes/build/html
|
2016-03-22 17:11:28 -07:00
|
|
|
|
2019-11-18 14:04:40 +00:00
|
|
|
[testenv:linters]
|
|
|
|
# Env vars and deps need to be defined in top level tox env
|
|
|
|
setenv =
|
|
|
|
ANSIBLE_LIBRARY = {toxinidir}/ansible/library
|
|
|
|
ANSIBLE_ACTION_PLUGINS = {toxinidir}/ansible/action_plugins
|
|
|
|
ANSIBLE_FILTER_PLUGINS = {toxinidir}/ansible/filter_plugins
|
|
|
|
deps =
|
2020-11-02 17:41:14 +08:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2022-09-29 16:37:39 +02:00
|
|
|
-r{toxinidir}/requirements.txt
|
2022-04-07 11:02:22 +02:00
|
|
|
-r{toxinidir}/lint-requirements.txt
|
2021-05-18 19:52:33 +08:00
|
|
|
allowlist_externals = bash
|
|
|
|
find
|
2019-11-18 14:04:40 +00:00
|
|
|
commands =
|
|
|
|
{[testenv:pep8]commands}
|
|
|
|
{[testenv:doc8]commands}
|
|
|
|
{[testenv:bandit]commands}
|
|
|
|
{[testenv:bashate]commands}
|
2020-05-18 15:39:34 +02:00
|
|
|
{[testenv:j2lint]commands}
|
2019-11-18 14:04:40 +00:00
|
|
|
{[testenv:yamllint]commands}
|
|
|
|
{[testenv:ansible-lint]commands}
|
|
|
|
|
|
|
|
[testenv:pep8]
|
|
|
|
deps = {[testenv:linters]deps}
|
|
|
|
commands =
|
|
|
|
flake8 {posargs}
|
|
|
|
|
2015-07-10 14:13:47 -07:00
|
|
|
[flake8]
|
|
|
|
show-source = True
|
2020-04-03 22:07:16 +02:00
|
|
|
# NOTE: Default ignore list is *not* empty!
|
|
|
|
# W504 line break after binary operator
|
2020-05-17 18:18:00 +08:00
|
|
|
# (W503 and W504 are incompatible and we need to choose one of them.
|
|
|
|
# Existing codes follows W503, so we disable W504.):
|
|
|
|
ignore = W504
|
2019-11-18 14:04:40 +00:00
|
|
|
exclude = .eggs,.git,.tox,doc
|
2018-03-22 14:22:43 -04:00
|
|
|
|
2019-11-18 14:04:40 +00:00
|
|
|
[testenv:doc8]
|
|
|
|
deps = {[testenv:linters]deps}
|
|
|
|
commands =
|
|
|
|
doc8 doc/source
|
2020-10-23 10:06:23 +02:00
|
|
|
reno lint
|
2019-11-18 14:04:40 +00:00
|
|
|
doc8 -e '.yaml' releasenotes/notes/
|
|
|
|
|
|
|
|
[testenv:bashate]
|
|
|
|
deps = {[testenv:linters]deps}
|
|
|
|
commands =
|
|
|
|
bash -c "{toxinidir}/tools/run-bashate.sh"
|
|
|
|
|
|
|
|
[testenv:bandit]
|
|
|
|
# B303: Use of insecure MD2, MD4, MD5, or SHA1 hash function.
|
|
|
|
deps = {[testenv:linters]deps}
|
|
|
|
commands = bandit --skip B303 -r ansible kolla_ansible tests tools
|
|
|
|
|
2020-05-18 15:39:34 +02:00
|
|
|
[testenv:j2lint]
|
|
|
|
deps = {[testenv:linters]deps}
|
|
|
|
commands =
|
|
|
|
find {toxinidir} -type f -name "*.j2" -not -path "*/.tox/*" -exec {toxinidir}/tests/j2lint.py \{\} +
|
|
|
|
|
2019-11-18 14:04:40 +00:00
|
|
|
[testenv:ansible-lint]
|
|
|
|
# Lint only code in ansible/* - ignore tests/ and roles/ used by CI
|
|
|
|
setenv = {[testenv:linters]setenv}
|
|
|
|
deps = {[testenv:linters]deps}
|
|
|
|
commands =
|
|
|
|
python {toxinidir}/tools/validate-all-file.py
|
2021-02-09 10:53:26 +00:00
|
|
|
ansible-lint -p --exclude {toxinidir}/tests --exclude {toxinidir}/roles --exclude {toxinidir}/etc
|
2019-11-18 14:04:40 +00:00
|
|
|
|
|
|
|
[testenv:yamllint]
|
|
|
|
deps = {[testenv:linters]deps}
|
|
|
|
commands = yamllint -s .
|