2014-10-03 09:26:36 +00:00
|
|
|
[tox]
|
2020-02-29 21:03:08 +00:00
|
|
|
minversion = 3.1
|
2015-03-28 17:08:33 +00:00
|
|
|
skipsdist = True
|
2020-09-17 11:27:54 +00:00
|
|
|
envlist = py38,linters
|
2020-02-29 21:03:08 +00:00
|
|
|
ignore_basepython_conflict = True
|
2014-10-03 09:26:36 +00:00
|
|
|
|
|
|
|
[testenv]
|
2019-11-20 10:47:46 +00:00
|
|
|
basepython = python3
|
2019-11-18 14:04:40 +00:00
|
|
|
usedevelop = True
|
2016-01-08 11:18:56 +00:00
|
|
|
whitelist_externals = find
|
2016-03-23 00:11:28 +00:00
|
|
|
rm
|
2019-07-03 02:37:51 +00:00
|
|
|
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2018-04-06 09:28:51 +00:00
|
|
|
-r{toxinidir}/requirements.txt
|
2015-07-10 21:13:47 +00:00
|
|
|
-r{toxinidir}/test-requirements.txt
|
2015-12-11 00:17:42 +00:00
|
|
|
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
2016-01-14 07:31:41 +00:00
|
|
|
OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_LOG_CAPTURE OS_TEST_TIMEOUT
|
|
|
|
PYTHON OS_TEST_PATH LISTOPT IDOPTION
|
2016-01-08 11:18:56 +00:00
|
|
|
commands =
|
2019-02-13 20:30:51 +00:00
|
|
|
find . -type f -name "*.py[c|o]" -delete -o -type l -name "*.py[c|o]" -delete
|
2016-09-20 06:39:30 +00:00
|
|
|
find . -type d -name "__pycache__" -delete
|
2018-07-10 10:44:27 +00:00
|
|
|
stestr run --slowest {posargs}
|
2014-10-03 09:26:36 +00:00
|
|
|
|
2016-09-20 12:18:05 +00:00
|
|
|
[testenv:debug]
|
2017-07-06 12:41:30 +00:00
|
|
|
commands = oslo_debug_helper -t tests {posargs}
|
2016-09-20 12:18:05 +00:00
|
|
|
|
2017-01-12 12:45:04 +00:00
|
|
|
[testenv:cover]
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
|
|
NOSE_WITH_COVERAGE=1
|
|
|
|
NOSE_COVER_BRANCHES=1
|
|
|
|
NOSE_COVER_HTML=1
|
|
|
|
NOSE_COVER_HTML_DIR={toxinidir}/cover
|
2019-06-04 16:43:45 +00:00
|
|
|
PYTHON=coverage run --source kolla_ansible,ansible/action_plugins,ansible/library,ansible/roles/keystone/files/ --parallel-mode
|
2018-07-10 10:44:27 +00:00
|
|
|
commands =
|
2019-11-18 14:04:40 +00:00
|
|
|
stestr run {posargs}
|
|
|
|
coverage combine
|
|
|
|
coverage html -d cover
|
|
|
|
coverage xml -o cover/coverage.xml
|
2016-03-08 16:50:37 +00:00
|
|
|
|
2015-09-03 00:15:54 +00:00
|
|
|
[testenv:venv]
|
2018-04-06 09:28:51 +00:00
|
|
|
deps =
|
2019-07-03 02:37:51 +00:00
|
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2018-04-06 09:28:51 +00:00
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-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]
|
2018-04-06 09:28:51 +00:00
|
|
|
deps =
|
2019-07-03 02:37:51 +00:00
|
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2018-04-06 09:28:51 +00:00
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2016-08-04 13:09:10 +00:00
|
|
|
commands =
|
2017-07-13 14:04:19 +00:00
|
|
|
rm -rf doc/build
|
2019-10-14 10:18:48 +00:00
|
|
|
sphinx-build -W --keep-going -b html doc/source doc/build/html
|
2015-08-28 01:38:42 +00:00
|
|
|
|
2017-01-27 06:55:04 +00:00
|
|
|
[testenv:deploy-guide]
|
2020-09-09 15:45:53 +00:00
|
|
|
deps = {[testenv:docs]deps}
|
2018-04-06 09:28:51 +00:00
|
|
|
commands =
|
|
|
|
rm -rf deploy-guide/build
|
2019-10-14 10:18:48 +00:00
|
|
|
sphinx-build -a -E -W -d deploy-guide/build/doctrees --keep-going -b html deploy-guide/source deploy-guide/build/html
|
2017-01-27 06:55:04 +00:00
|
|
|
|
2019-09-17 10:50:41 +00:00
|
|
|
[testenv:pdf-docs]
|
|
|
|
whitelist_externals = make
|
|
|
|
deps = {[testenv:docs]deps}
|
|
|
|
commands =
|
2019-10-14 10:18:48 +00:00
|
|
|
sphinx-build -W --keep-going -b latex doc/source doc/build/pdf
|
2019-09-17 10:50:41 +00:00
|
|
|
make -C doc/build/pdf
|
|
|
|
|
2016-03-23 00:11:28 +00:00
|
|
|
[testenv:releasenotes]
|
2020-09-09 15:45:53 +00:00
|
|
|
deps = {[testenv:docs]deps}
|
2016-03-23 00:11:28 +00:00
|
|
|
commands =
|
|
|
|
rm -rf releasenotes/build
|
2019-10-14 10:18:48 +00:00
|
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
|
2016-03-23 00:11:28 +00:00
|
|
|
|
2019-11-18 14:04:40 +00:00
|
|
|
[testenv:lower-constraints]
|
|
|
|
deps =
|
|
|
|
-c{toxinidir}/lower-constraints.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
|
|
|
|
[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 =
|
|
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
|
|
|
whitelist_externals = bash
|
|
|
|
commands =
|
|
|
|
{[testenv:pep8]commands}
|
|
|
|
{[testenv:doc8]commands}
|
|
|
|
{[testenv:bandit]commands}
|
|
|
|
{[testenv:bashate]commands}
|
|
|
|
{[testenv:yamllint]commands}
|
|
|
|
{[testenv:ansible-lint]commands}
|
|
|
|
|
|
|
|
[testenv:pep8]
|
|
|
|
deps = {[testenv:linters]deps}
|
|
|
|
commands =
|
|
|
|
flake8 {posargs}
|
|
|
|
|
2015-07-10 21:13:47 +00:00
|
|
|
[flake8]
|
|
|
|
show-source = True
|
2020-04-03 20:07:16 +00:00
|
|
|
# NOTE: Default ignore list is *not* empty!
|
|
|
|
# W504 line break after binary operator
|
2020-05-17 10:18:00 +00: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 18:22:43 +00:00
|
|
|
|
2019-11-18 14:04:40 +00:00
|
|
|
[testenv:doc8]
|
|
|
|
deps = {[testenv:linters]deps}
|
|
|
|
commands =
|
|
|
|
doc8 doc/source
|
|
|
|
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
|
|
|
|
|
|
|
|
[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
|
|
|
|
ansible-lint -p --exclude {toxinidir}/tests --exclude {toxinidir}/roles
|
|
|
|
|
|
|
|
[testenv:yamllint]
|
|
|
|
deps = {[testenv:linters]deps}
|
|
|
|
commands = yamllint -s .
|