2012-09-25 08:00:23 +01:00
|
|
|
[tox]
|
2021-06-16 16:00:14 +08:00
|
|
|
minversion = 3.18.0
|
2020-10-12 10:59:32 +08:00
|
|
|
envlist = py3,flake8
|
2020-02-07 13:36:08 +00:00
|
|
|
ignore_basepython_conflict = True
|
2013-10-16 14:02:23 +01:00
|
|
|
skipsdist = True
|
2012-09-25 08:00:23 +01:00
|
|
|
|
|
|
|
[testenv]
|
2019-11-15 03:36:42 +00:00
|
|
|
basepython = python3
|
2015-02-24 12:34:48 +00:00
|
|
|
setenv =
|
2019-03-26 23:02:02 -07:00
|
|
|
VIRTUAL_ENV={envdir}
|
|
|
|
LANGUAGE=C.UTF-8
|
|
|
|
LC_ALL=C.UTF-8
|
|
|
|
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
|
|
|
|
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
|
|
|
|
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
|
|
|
|
OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:180}
|
2015-02-24 12:34:48 +00:00
|
|
|
PYTHONDONTWRITEBYTECODE=1
|
2019-03-26 23:02:02 -07:00
|
|
|
PYTHONWARNINGS=default::DeprecationWarning,ignore::DeprecationWarning:distutils,ignore::DeprecationWarning:site
|
|
|
|
passenv =
|
|
|
|
http_proxy
|
|
|
|
HTTP_PROXY
|
|
|
|
https_proxy
|
|
|
|
HTTPS_PROXY
|
|
|
|
no_proxy
|
|
|
|
NO_PROXY
|
|
|
|
OS_DEBUG
|
|
|
|
usedevelop = True
|
|
|
|
install_command =
|
|
|
|
pip install {opts} {packages}
|
2015-01-24 10:59:14 -08:00
|
|
|
commands =
|
2016-09-15 18:03:42 +05:30
|
|
|
find . -type f -name "*.py[c|o]" -delete
|
2017-06-07 21:14:03 +07:00
|
|
|
rm -f .testrepository/times.dbm
|
2020-02-07 13:36:08 +00:00
|
|
|
stestr run {posargs}
|
2019-03-26 23:02:02 -07:00
|
|
|
deps =
|
2020-10-22 11:03:25 +08:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2019-03-26 23:02:02 -07:00
|
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2021-06-22 10:07:55 +08:00
|
|
|
allowlist_externals =
|
2019-03-26 23:02:02 -07:00
|
|
|
sh
|
|
|
|
find
|
|
|
|
rm
|
2012-09-25 08:00:23 +01:00
|
|
|
|
2015-02-13 17:27:36 +00:00
|
|
|
[testenv:docs]
|
2018-03-27 10:30:27 +08:00
|
|
|
deps =
|
2020-10-22 11:03:25 +08:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2022-04-04 22:16:23 +00:00
|
|
|
-r{toxinidir}/requirements.txt
|
2018-03-27 10:30:27 +08:00
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2018-05-21 18:36:04 +08:00
|
|
|
commands =
|
|
|
|
rm -rf doc/build
|
|
|
|
sphinx-build -W -b html doc/source doc/build/html
|
2015-02-13 17:27:36 +00:00
|
|
|
|
2019-08-26 13:41:01 -06:00
|
|
|
[testenv:pdf-docs]
|
|
|
|
deps = {[testenv:docs]deps}
|
2021-06-22 10:07:55 +08:00
|
|
|
allowlist_externals =
|
2019-08-26 13:41:01 -06:00
|
|
|
make
|
|
|
|
commands =
|
|
|
|
sphinx-build -W -b latex doc/source doc/build/pdf
|
|
|
|
make -C doc/build/pdf
|
|
|
|
|
2012-09-25 08:00:23 +01:00
|
|
|
[testenv:cover]
|
2018-07-09 13:11:14 +07:00
|
|
|
setenv =
|
|
|
|
{[testenv]setenv}
|
|
|
|
PYTHON=coverage run --source designate --parallel-mode
|
2017-06-16 11:33:58 +07:00
|
|
|
commands =
|
|
|
|
coverage erase
|
|
|
|
find . -type f -name "*.pyc" -delete
|
2018-07-09 13:11:14 +07:00
|
|
|
stestr run --no-subunit-trace {posargs}
|
|
|
|
coverage combine
|
|
|
|
coverage html -d cover
|
|
|
|
coverage xml -o cover/coverage.xml
|
2022-05-04 22:45:10 +00:00
|
|
|
coverage report --fail-under=83 --skip-covered
|
2012-09-25 08:00:23 +01:00
|
|
|
|
2016-01-13 09:07:36 +05:30
|
|
|
[testenv:bandit]
|
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2019-05-14 14:12:26 -07:00
|
|
|
commands = bandit -r designate -n5 -x 'designate/tests/*' -t \
|
2018-08-17 14:34:38 -07:00
|
|
|
B505,B504,B503,B502,B501,B604,B605,B001,B601,B602,B701,B609,B702,\
|
|
|
|
B608,B506,B312,B310,B411,B108,B103,B102,B309,B308,B302,B307,B306
|
2016-01-13 09:07:36 +05:30
|
|
|
|
2015-01-24 11:28:27 -08:00
|
|
|
[testenv:debug]
|
2017-03-09 22:07:57 +07:00
|
|
|
commands = oslo_debug_helper -t designate/tests {posargs}
|
2015-01-24 11:28:27 -08:00
|
|
|
|
2013-06-09 14:30:05 +01:00
|
|
|
[testenv:flake8]
|
2016-05-10 16:04:33 +01:00
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2015-06-02 16:36:23 +01:00
|
|
|
commands = sh tools/pretty_flake8.sh
|
2016-05-10 16:04:33 +01:00
|
|
|
{[testenv:bandit]commands}
|
2013-06-09 14:30:05 +01:00
|
|
|
|
2012-09-25 08:00:23 +01:00
|
|
|
[testenv:pep8]
|
2016-05-10 16:04:33 +01:00
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2015-06-02 16:36:23 +01:00
|
|
|
commands = sh tools/pretty_flake8.sh
|
2016-05-10 16:04:33 +01:00
|
|
|
{[testenv:bandit]commands}
|
2018-05-10 10:08:06 +07:00
|
|
|
doc8 {posargs}
|
2012-11-18 03:03:58 +00:00
|
|
|
|
2017-06-10 00:21:01 +07:00
|
|
|
[testenv:genconfig]
|
|
|
|
commands = oslo-config-generator --config-file=etc/designate/designate-config-generator.conf
|
|
|
|
|
2017-10-03 10:58:38 +07:00
|
|
|
[testenv:genpolicy]
|
|
|
|
commands = oslopolicy-sample-generator --config-file etc/designate/designate-policy-generator.conf
|
|
|
|
|
2014-11-28 18:11:59 +00:00
|
|
|
[testenv:bashate]
|
|
|
|
deps = bashate
|
2021-06-22 10:07:55 +08:00
|
|
|
allowlist_externals = bash
|
2015-10-08 18:20:16 +02:00
|
|
|
commands = bash -c "find {toxinidir}/devstack \
|
2015-12-16 14:18:29 +00:00
|
|
|
-not \( -type d -name .?\* -prune \) \
|
|
|
|
-not \( -type d -name doc -prune \) \
|
|
|
|
-type f \
|
|
|
|
-not -name \*~ \
|
2014-11-28 18:11:59 +00:00
|
|
|
-not -name \*.md \
|
|
|
|
\( \
|
|
|
|
-name \*.sh -or \
|
|
|
|
-name \*rc -or \
|
|
|
|
-name functions\* -or \
|
2015-12-16 14:18:29 +00:00
|
|
|
-wholename \*/lib/\* \
|
|
|
|
\) \
|
2014-11-28 18:11:59 +00:00
|
|
|
-print0 | xargs -0 bashate -v"
|
|
|
|
|
2015-05-09 12:32:32 +01:00
|
|
|
[testenv:pip-check-reqs]
|
2014-11-14 12:36:13 +00:00
|
|
|
# do not install test-requirements as that will pollute the virtualenv for
|
|
|
|
# determining missing packages
|
|
|
|
# this also means that pip-missing-reqs must be installed separately, outside
|
|
|
|
# of the requirements.txt files
|
2015-05-09 12:32:32 +01:00
|
|
|
deps = pip-check-reqs
|
2014-12-09 16:25:45 +00:00
|
|
|
-r{toxinidir}/requirements.txt
|
2014-11-14 12:36:13 +00:00
|
|
|
commands=pip-missing-reqs -d --ignore-file=designate/tests/* designate
|
|
|
|
|
2016-05-13 16:11:42 +01:00
|
|
|
[testenv:api-ref]
|
|
|
|
# This environment is called from CI scripts to test and publish
|
2019-07-22 18:36:31 +02:00
|
|
|
# the API Ref to docs.openstack.org.
|
2019-05-25 11:52:46 +02:00
|
|
|
deps =
|
2020-10-22 11:03:25 +08:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2019-05-25 11:52:46 +02:00
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2016-05-13 16:11:42 +01:00
|
|
|
commands =
|
|
|
|
rm -rf api-ref/build
|
2016-05-30 10:59:11 +02:00
|
|
|
sphinx-build -E -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
|
2016-05-13 16:11:42 +01:00
|
|
|
|
2015-11-19 16:57:44 +00:00
|
|
|
[testenv:releasenotes]
|
2018-03-27 10:30:27 +08:00
|
|
|
deps =
|
2020-10-22 11:03:25 +08:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2018-03-27 10:30:27 +08:00
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2018-05-21 18:36:04 +08:00
|
|
|
commands =
|
|
|
|
rm -rf releasenotes/build
|
|
|
|
sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
2015-11-19 16:57:44 +00:00
|
|
|
|
2012-11-18 03:03:58 +00:00
|
|
|
[testenv:venv]
|
|
|
|
commands = {posargs}
|
2018-10-15 12:01:02 -04:00
|
|
|
deps = -r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2013-06-09 14:30:05 +01:00
|
|
|
|
2018-05-10 10:08:06 +07:00
|
|
|
[doc8]
|
|
|
|
ignore-path = .venv,.git,.tox,*designate/locale*,*lib/python*,*designate.egg*,api-ref/build,doc/build,doc/source/contributor/api
|
|
|
|
|
2013-06-09 14:30:05 +01:00
|
|
|
[flake8]
|
2014-06-17 09:30:40 -05:00
|
|
|
# ignored flake8 codes:
|
2017-03-07 16:09:10 +00:00
|
|
|
# H105 don't use author tags. We use version control instead
|
2014-06-17 09:30:40 -05:00
|
|
|
# H404 multi line docstring should start with a summary
|
|
|
|
# H405 multi line docstring summary not separated with an empty line
|
2017-03-07 16:09:10 +00:00
|
|
|
# H501 Do not use locals() or self.__dict__ for string formatting.
|
2014-06-17 09:30:40 -05:00
|
|
|
# E126 continuation line over-indented for hanging indent
|
|
|
|
# E128 continuation line under-indented for visual indent
|
2020-03-29 14:39:10 +02:00
|
|
|
# W504 line break after binary operator
|
2022-06-16 09:31:18 +02:00
|
|
|
ignore = H105,H404,H405,H501,E126,E128,W504
|
2016-10-14 16:14:42 +05:30
|
|
|
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,.ropeproject
|
2014-06-01 18:26:27 +01:00
|
|
|
|
|
|
|
[hacking]
|
2016-12-01 09:20:45 +00:00
|
|
|
import_exceptions = designate.i18n
|
2018-03-22 11:11:35 -04:00
|
|
|
|
2020-03-29 14:39:10 +02:00
|
|
|
[flake8:local-plugins]
|
|
|
|
extension =
|
|
|
|
D701 = checks:mutable_default_arguments
|
|
|
|
D703 = checks:check_explicit_underscore_import
|
|
|
|
D704 = checks:no_import_graduated_oslo_libraries
|
|
|
|
D705 = checks:use_timeutils_utcnow
|
|
|
|
D706 = checks:no_translate_debug_logs
|
|
|
|
D707 = checks:check_no_basestring
|
|
|
|
D708 = checks:check_python3_xrange
|
|
|
|
D709 = checks:check_no_log_audit
|
2021-11-30 00:20:52 +00:00
|
|
|
D710 = checks:check_no_log_warn
|
2020-03-29 14:39:10 +02:00
|
|
|
paths = ./designate/hacking
|
|
|
|
|
2022-01-24 23:02:45 +00:00
|
|
|
[testenv:dnspython-latest]
|
|
|
|
commands =
|
|
|
|
python -m pip install -U dnspython --pre
|
|
|
|
{[testenv]commands}
|