2013-03-01 08:17:18 -08:00
|
|
|
[tox]
|
2021-06-10 09:31:46 +08:00
|
|
|
minversion = 3.18.0
|
2022-05-12 17:54:51 +08:00
|
|
|
envlist = py38,py39,pep8,docs
|
2016-10-29 22:05:53 +08:00
|
|
|
skipsdist = True
|
2020-01-23 11:56:33 -06:00
|
|
|
ignore_basepython_conflict = True
|
2013-03-01 08:17:18 -08:00
|
|
|
|
|
|
|
[testenv]
|
2019-11-15 01:29:13 +00:00
|
|
|
basepython = python3
|
2018-07-11 15:05:28 +07:00
|
|
|
setenv =
|
|
|
|
PYTHON=coverage run --source barbican --parallel-mode
|
2016-10-29 22:05:53 +08:00
|
|
|
usedevelop = True
|
2020-04-28 10:55:25 +02:00
|
|
|
deps =
|
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2013-06-26 15:23:41 -05:00
|
|
|
|
2014-03-12 23:15:11 -04:00
|
|
|
commands =
|
2016-07-11 19:41:28 +02:00
|
|
|
oslo-config-generator --config-file etc/oslo-config-generator/barbican.conf --output-file etc/barbican/barbican.conf
|
2016-09-16 13:46:20 +05:30
|
|
|
/usr/bin/find . -type f -name "*.py[c|o]" -delete
|
2017-04-28 10:41:25 +05:30
|
|
|
rm -f .testrepository/times.dbm
|
2016-08-01 16:08:03 +08:00
|
|
|
coverage erase
|
2018-10-09 09:58:12 +07:00
|
|
|
stestr run {posargs}
|
2018-07-11 15:05:28 +07:00
|
|
|
coverage combine
|
|
|
|
coverage html -d cover
|
|
|
|
coverage xml -o cover/coverage.xml
|
2014-01-27 18:19:53 -06:00
|
|
|
coverage report -m
|
2021-06-10 09:31:46 +08:00
|
|
|
allowlist_externals = rm
|
2013-08-01 18:14:57 -05:00
|
|
|
|
2014-11-17 10:02:04 -06:00
|
|
|
[testenv:cover]
|
2014-10-29 10:36:10 -05:00
|
|
|
deps =
|
|
|
|
{[testenv]deps}
|
|
|
|
diff_cover
|
|
|
|
commands =
|
2016-09-20 00:13:36 +08:00
|
|
|
coverage erase
|
2018-10-09 09:58:12 +07:00
|
|
|
stestr run {posargs}
|
2018-07-11 15:05:28 +07:00
|
|
|
coverage combine
|
|
|
|
coverage html -d cover
|
|
|
|
coverage xml -o cover/coverage.xml
|
|
|
|
diff-cover --fail-under 100 --compare-branch master cover/coverage.xml
|
2014-10-29 10:36:10 -05:00
|
|
|
|
2015-11-30 10:57:55 -05:00
|
|
|
[testenv:releasenotes]
|
2020-04-28 10:48:37 +02:00
|
|
|
deps = {[testenv:docs]deps}
|
2018-05-14 16:15:46 +08:00
|
|
|
commands =
|
|
|
|
rm -rf releasenotes/build
|
|
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
2015-11-30 10:57:55 -05:00
|
|
|
|
2014-01-02 15:16:31 -06:00
|
|
|
[testenv:pep8]
|
2014-06-02 15:18:56 -05:00
|
|
|
sitepackages = False
|
2016-02-26 19:19:54 +01:00
|
|
|
commands =
|
2018-07-03 15:38:19 +07:00
|
|
|
doc8 {posargs}
|
2016-02-26 19:19:54 +01:00
|
|
|
flake8 {posargs}
|
|
|
|
# Run security linter
|
2019-06-25 11:22:40 +08:00
|
|
|
bandit -r barbican -x tests -n5 -s B105
|
2014-01-02 15:16:31 -06:00
|
|
|
|
2016-07-11 19:41:28 +02:00
|
|
|
[testenv:genconfig]
|
2021-06-10 09:31:46 +08:00
|
|
|
allowlist_externals = bash
|
2018-01-24 10:05:05 +07:00
|
|
|
envdir = {toxworkdir}/pep8
|
2016-07-11 19:41:28 +02:00
|
|
|
commands =
|
|
|
|
oslo-config-generator --config-file etc/oslo-config-generator/barbican.conf
|
|
|
|
|
2014-08-01 13:10:45 -05:00
|
|
|
[testenv:venv]
|
|
|
|
commands = {posargs}
|
|
|
|
|
2015-08-03 14:26:17 -05:00
|
|
|
[testenv:debug]
|
2017-12-27 14:55:10 +07:00
|
|
|
commands = oslo_debug_helper -t barbican/tests {posargs}
|
2015-08-03 14:26:17 -05:00
|
|
|
|
2014-08-25 10:53:10 -10:00
|
|
|
[testenv:py3pep8]
|
|
|
|
# This hack is in place to allow us to run py3 based flake8
|
|
|
|
# without installing barbican.
|
|
|
|
install_command = /bin/echo {packages}
|
|
|
|
commands =
|
2020-04-01 20:56:29 +02:00
|
|
|
pip install "hacking>=3.0,<3.1.0"
|
2014-08-25 10:53:10 -10:00
|
|
|
flake8 barbican setup.py
|
|
|
|
|
2014-08-01 13:10:45 -05:00
|
|
|
[testenv:docs]
|
2018-10-27 16:43:08 +02:00
|
|
|
# This environment is called from CI scripts to test and publish
|
|
|
|
# the main docs to https://docs.openstack.org/barbican
|
|
|
|
description = Build main documentation
|
2020-04-28 10:55:25 +02:00
|
|
|
deps =
|
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2014-08-01 13:10:45 -05:00
|
|
|
commands=
|
2019-09-23 15:05:40 +01:00
|
|
|
rm -rf doc/build doc/build/doctrees
|
2018-05-31 10:03:39 +07:00
|
|
|
sphinx-build -W -b html doc/source doc/build/html
|
2021-06-10 09:31:46 +08:00
|
|
|
allowlist_externals = rm
|
2016-02-24 11:24:32 -08:00
|
|
|
|
2019-09-23 15:05:40 +01:00
|
|
|
[testenv:pdf-docs]
|
|
|
|
deps = {[testenv:docs]deps}
|
2021-06-10 09:31:46 +08:00
|
|
|
allowlist_externals =
|
2019-09-23 15:05:40 +01:00
|
|
|
make
|
|
|
|
commands =
|
|
|
|
sphinx-build -W -b latex doc/source doc/build/pdf
|
|
|
|
make -C doc/build/pdf
|
|
|
|
|
2016-02-24 11:24:32 -08:00
|
|
|
[testenv:api-guide]
|
|
|
|
# This environment is called from CI scripts to test and publish
|
2019-07-22 18:48:12 +02:00
|
|
|
# the API Guide to docs.openstack.org.
|
2020-04-28 10:48:37 +02:00
|
|
|
deps = {[testenv:docs]deps}
|
2016-02-24 11:24:32 -08:00
|
|
|
commands =
|
2018-05-14 16:15:46 +08:00
|
|
|
rm -rf api-guide/build
|
2016-03-21 20:39:03 +01:00
|
|
|
sphinx-build -W -b html -d api-guide/build/doctrees api-guide/source api-guide/build/html
|
2014-08-01 13:10:45 -05:00
|
|
|
|
2018-10-27 16:43:08 +02:00
|
|
|
[testenv:all-docs]
|
|
|
|
description = Build all documentation
|
2020-04-28 10:48:37 +02:00
|
|
|
deps = {[testenv:docs]deps}
|
2018-10-27 16:43:08 +02:00
|
|
|
commands=
|
|
|
|
{[testenv:docs]commands}
|
|
|
|
{[testenv:api-guide]commands}
|
|
|
|
{[testenv:releasenotes]commands}
|
2021-06-10 09:31:46 +08:00
|
|
|
allowlist_externals = rm
|
2018-10-27 16:43:08 +02:00
|
|
|
|
2014-10-02 19:10:09 -05:00
|
|
|
[testenv:functional]
|
|
|
|
# This tox env is purely to make local test development easier
|
|
|
|
# Note: This requires local running instances of Barbican and Keystone
|
2019-02-04 13:24:42 -06:00
|
|
|
# TODO(dmend): remove --serial and uncomment coverage commands
|
2020-04-28 10:55:25 +02:00
|
|
|
deps =
|
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2018-07-11 15:05:28 +07:00
|
|
|
setenv =
|
|
|
|
OS_TEST_PATH={toxinidir}/functionaltests
|
2015-08-28 01:38:39 -05:00
|
|
|
commands =
|
2016-09-16 13:46:20 +05:30
|
|
|
/usr/bin/find . -type f -name "*.py[c|o]" -delete
|
2019-02-04 13:24:42 -06:00
|
|
|
stestr run --serial --slowest {posargs}
|
|
|
|
# coverage combine
|
|
|
|
# coverage html -d cover
|
|
|
|
# coverage xml -o cover/coverage.xml
|
2016-03-13 14:14:04 -04:00
|
|
|
passenv = KMIP_PLUGIN_ENABLED
|
2018-07-27 14:46:38 +12:00
|
|
|
VAULT_PLUGIN_ENABLED
|
2018-08-02 16:35:19 -04:00
|
|
|
PKCS11_PLUGIN_ENABLED
|
2014-10-02 19:10:09 -05:00
|
|
|
|
2016-08-04 16:21:06 -05:00
|
|
|
[testenv:cmd]
|
|
|
|
# This tox env is purely to make local test development easier
|
|
|
|
# Note: This requires local running instances of Barbican and Keystone
|
2020-04-28 10:55:25 +02:00
|
|
|
deps =
|
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2018-07-11 15:05:28 +07:00
|
|
|
setenv =
|
|
|
|
OS_TEST_PATH={toxinidir}/barbican/cmd/functionaltests
|
2016-08-04 16:21:06 -05:00
|
|
|
commands =
|
2017-09-27 17:13:29 +08:00
|
|
|
/usr/bin/find . -type f -name "*.py[c|o]" -delete
|
2018-10-09 09:58:12 +07:00
|
|
|
stestr run {posargs}
|
2018-07-11 15:05:28 +07:00
|
|
|
coverage combine
|
|
|
|
coverage html -d cover
|
|
|
|
coverage xml -o cover/coverage.xml
|
2016-08-04 16:21:06 -05:00
|
|
|
|
2018-07-03 15:38:19 +07:00
|
|
|
[doc8]
|
|
|
|
ignore = D001
|
|
|
|
ignore-path = .venv,.git,.tox,.tmp,*barbican/locale*,*lib/python*,barbican.egg*,doc/build,releasenotes/*,doc/source/contributor/api
|
|
|
|
|
2013-08-01 18:14:57 -05:00
|
|
|
[flake8]
|
2017-11-28 15:29:19 +07:00
|
|
|
filename = *.py,app.wsgi
|
2016-10-09 02:26:57 +05:30
|
|
|
exclude = .git,.idea,.tox,bin,dist,debian,rpmbuild,tools,*.egg-info,*.eggs,contrib,
|
2017-07-01 11:38:19 +08:00
|
|
|
*docs/target,*.egg,build
|
2020-04-01 20:56:29 +02:00
|
|
|
# E402 module level import not at top of file
|
|
|
|
# W503 line break before binary operator
|
|
|
|
# W504 line break after binary operator
|
|
|
|
ignore = E402,W503,W504,
|
2015-04-08 20:21:04 -04:00
|
|
|
|
|
|
|
[testenv:bandit]
|
2015-09-09 16:45:29 -04:00
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2019-08-05 16:28:44 +02:00
|
|
|
commands = bandit -r barbican -x tests -n5
|
2016-08-17 00:38:00 -04:00
|
|
|
|
2016-10-29 22:05:53 +08:00
|
|
|
[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
|
2016-11-11 18:07:02 +08:00
|
|
|
|
2017-02-09 18:19:15 +08:00
|
|
|
[testenv:genpolicy]
|
2018-01-24 10:05:05 +07:00
|
|
|
envdir = {toxworkdir}/pep8
|
2017-02-09 18:19:15 +08:00
|
|
|
commands = oslopolicy-sample-generator --config-file=etc/oslo-config-generator/policy.conf
|
|
|
|
|
2020-04-01 20:56:29 +02:00
|
|
|
[flake8:local-plugins]
|
|
|
|
extension =
|
|
|
|
B310 = checks:CheckLoggingFormatArgs
|
|
|
|
B311 = checks:validate_assertIsNone
|
|
|
|
B312 = checks:validate_assertTrue
|
|
|
|
B317 = checks:check_oslo_namespace_imports
|
|
|
|
B318 = checks:dict_constructor_with_list_copy
|
|
|
|
B319 = checks:no_xrange
|
|
|
|
B320 = checks:no_log_warn_check
|
|
|
|
B321 = checks:validate_assertIsNotNone
|
|
|
|
paths = ./barbican/hacking
|