solum/tox.ini
Erik Olof Gunnar Andersson e70179000d Fix broken CI and lower-constraints
We need to monkey patch the tests to make sure
we get the same order of operations as we would
when running the service.

This patch also fixes issues with lower-constraints. I based
the fix on the same fix as I did for Designate and Senlin.

Change-Id: Ie325affdb24ba01e762f0832db80e0c46e635f60
2021-01-16 15:07:35 -08:00

107 lines
2.5 KiB
INI

[tox]
minversion = 2.0
envlist = py38,py36,pep8
skipsdist = True
ignore_basepython_conflict = True
[testenv]
basepython = python3
usedevelop = True
install_command =
pip install {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals = find
rm
commands =
find . -type f -name "*.pyc" -delete
rm -f .testrepository/times.dbm
stestr run {posargs}
[testenv:pep8]
commands =
flake8
{toxinidir}/tools/check_for_alembic_branches.sh
[testenv:venv]
commands = {posargs}
[testenv:cover]
setenv =
{[testenv]setenv}
PYTHON=coverage run --source solum --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:debug]
commands = oslo_debug_helper -t solum/tests {posargs}
[testenv:docs]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs]
deps = {[testenv:docs]deps}
whitelist_externals =
make
commands =
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:genconfig]
commands =
oslo-config-generator --config-file=etc/solum/config-generator.conf
[testenv:genpolicy]
commands =
oslopolicy-sample-generator --config-file=etc/solum/policy-generator.conf
[testenv:releasenotes]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8]
show-source = True
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[hacking]
import_exceptions = solum.i18n
[flake8:local-plugins]
extension =
M322 = checks:no_mutable_default_args
paths = ./solum/hacking
[testenv:lower-constraints]
skip_install = True
commands =
python -m pip install --no-deps -U .
stestr run {posargs}
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
[testenv:bandit]
deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r solum -n5 -x tests -ll
[testenv:bandit-baseline]
envdir = {toxworkdir}/bandit
commands = bandit-baseline -r solum -n5 -x tests -ii -ll