castellan/tox.ini
Andreas Jaeger a39ed69ea0 Some Cleanups
This repo is now Python 3, update:
- Remove python 2.7 stanza from setup.py
- Remove install_command from tox.ini, the default is fine
- Remove Babel from requirements, it's not needed for running.
- Use TOX_CONSTRAINTS_FILE instead of obsolete UPPER_CONSTRAINTS_FILE.
- Use py36 for fault test

Change-Id: Ia23841a4899361178994e349e1323de857b4ee23
2020-06-11 12:26:35 +02:00

126 lines
3.7 KiB
INI

[tox]
minversion = 3.1.1
envlist = py38,pep8
ignore_basepython_conflict = True
skipsdist = True
[testenv]
usedevelop = True
basepython = python3
setenv =
VIRTUAL_ENV={envdir}
OS_TEST_PATH=./castellan/tests/unit
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = stestr run --slowest {posargs}
[testenv:pep8]
commands =
flake8
bandit -r castellan -x tests -s B105,B106,B107,B607
[testenv:bandit]
# This command runs the bandit security linter against the castellan
# codebase minus the tests directory. Some tests are being excluded to
# reduce the number of positives before a team inspection, and to ensure a
# passing gate job for initial addition. The excluded tests are:
# B105-B107: hardcoded password checks - likely to generate false positives
# in a gate environment
# B607: start process with a partial path - this should be a project level
# decision
commands =
bandit -r castellan -x tests -s B105,B106,B107,B607
[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 = -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
whitelist_externals = rm
[testenv:pdf-docs]
deps = {[testenv:docs]deps}
envdir = {toxworkdir}/docs
whitelist_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}
envdir = {toxworkdir}/docs
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:functional]
usedevelop = True
setenv =
VIRTUAL_ENV={envdir}
OS_TEST_PATH=./castellan/tests/functional
commands = stestr run --slowest {posargs}
[testenv:functional-vault]
passenv = HOME
usedevelop = True
setenv =
VIRTUAL_ENV={envdir}
OS_TEST_PATH=./castellan/tests/functional
commands =
{toxinidir}/tools/setup-vault-env.sh pifpaf -e VAULT_TEST run vault -- stestr run --slowest {posargs}
[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:lower-constraints]
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
[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