
tox automatically injects the environment so no manual override is necessary. Also remove basepython because tox uses the python version where tox is installed by default, and we no longer expect that the tests may run in env with python 2. Change-Id: I9dc0c5d49b29557435f7b356fe3aaa5554849d93
106 lines
2.9 KiB
INI
106 lines
2.9 KiB
INI
[tox]
|
|
minversion = 4.0.0
|
|
envlist = py3,pep8
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
setenv =
|
|
OS_TEST_PATH=./castellan/tests/unit
|
|
deps =
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands = stestr run --slowest --concurrency=1 {posargs}
|
|
|
|
[testenv:pep8]
|
|
skip_install = true
|
|
deps =
|
|
pre-commit
|
|
commands =
|
|
pre-commit run -a
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:debug]
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
[testenv:cover]
|
|
setenv =
|
|
PYTHON=coverage run --source castellan --parallel-mode
|
|
commands =
|
|
coverage erase
|
|
{[testenv]commands}
|
|
coverage combine
|
|
coverage html -d cover
|
|
coverage xml -o cover/coverage.xml
|
|
coverage report --show-missing
|
|
|
|
[testenv:docs]
|
|
# This environment is called from CI scripts to test and publish
|
|
# the main docs to https://docs.openstack.org/castellan
|
|
description = Build main documentation
|
|
deps =
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands=
|
|
rm -rf doc/build doc/build/doctrees
|
|
sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html
|
|
allowlist_externals = rm
|
|
|
|
[testenv:pdf-docs]
|
|
deps = {[testenv:docs]deps}
|
|
allowlist_externals =
|
|
rm
|
|
make
|
|
commands =
|
|
rm -rf doc/build/pdf
|
|
sphinx-build -W -b latex doc/source doc/build/pdf
|
|
make -C doc/build/pdf
|
|
|
|
[testenv:releasenotes]
|
|
deps = {[testenv:docs]deps}
|
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
|
|
[testenv:functional]
|
|
usedevelop = True
|
|
setenv =
|
|
OS_TEST_PATH=./castellan/tests/functional
|
|
commands = stestr run --slowest --concurrency=1 {posargs}
|
|
|
|
[testenv:functional-vault]
|
|
passenv = HOME
|
|
usedevelop = True
|
|
setenv =
|
|
OS_TEST_PATH=./castellan/tests/functional
|
|
commands =
|
|
{toxinidir}/tools/setup-vault-env.sh pifpaf -e VAULT_TEST run vault -- stestr run --concurrency=1 --slowest {posargs}
|
|
allowlist_externals =
|
|
{toxinidir}/tools/setup-vault-env.sh
|
|
|
|
[testenv:genconfig]
|
|
commands =
|
|
oslo-config-generator --config-file=etc/castellan/functional-config-generator.conf
|
|
oslo-config-generator --config-file=etc/castellan/sample-config-generator.conf
|
|
|
|
[flake8]
|
|
# [H106] Don't put vim configuration in source files.
|
|
# [H203] Use assertIs(Not)None to check for None.
|
|
show-source = True
|
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
|
enable-extensions = H106,H203
|
|
|
|
[hacking]
|
|
import_exceptions = castellan.i18n
|
|
|
|
[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, and develop mode disabled
|
|
# explicitly to avoid unnecessarily installing the checked-out repo too (this
|
|
# further relies on "tox.skipsdist = True" above).
|
|
deps = bindep
|
|
commands = bindep test
|
|
usedevelop = False
|