karbor/tox.ini

92 lines
2.5 KiB
INI

[tox]
minversion = 3.1.1
envlist = py37,pypy,pep8
skipsdist = True
ignore_basepython_conflict = True
[testenv]
basepython = python3
usedevelop = True
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -U {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
OS_TEST_PATH=./karbor/tests/unit
PYTHONWARNINGS=default::DeprecationWarning
LANGUAGE=en_US
LC_ALL=en_US.utf-8
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals = sh /bin/rm
commands =
/bin/rm -f .testrepository/times.dbm
stestr run {posargs}
stestr slowest
[testenv:fullstack]
setenv = OS_TEST_PATH=./karbor/tests/fullstack
OS_TEST_TIMEOUT=3600
commands =
oslo-config-generator --config-file etc/oslo-config-generator/karbor.conf --output-file etc/karbor.conf
stestr --test-path=./karbor/tests/fullstack run '{posargs}'
stestr slowest
[testenv:pep8]
commands = flake8
[testenv:venv]
commands = {posargs}
[testenv:cover]
setenv =
{[testenv]setenv}
PYTHON=coverage run --source karbor --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:docs]
whitelist_externals = sh /bin/rm
commands = /bin/rm -rf doc/build
/bin/rm -rf doc/source/contributor/api
sphinx-build -W -b html doc/source doc/build/html
[testenv:debug]
commands = oslo_debug_helper -t karbor/tests/unit {posargs}
[testenv:api-ref]
# This environment is called from CI scripts to test and publish
# the API Ref to docs.openstack.org.
whitelist_externals = sh /bin/rm
deps = -r{toxinidir}/test-requirements.txt
commands =
/bin/rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html/
[testenv:releasenotes]
commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:genconfig]
commands = oslo-config-generator --config-file etc/oslo-config-generator/karbor.conf
[testenv:genpolicy]
commands = oslopolicy-sample-generator --config-file=etc/karbor-policy-generator.conf
[flake8]
show-source = True
# W503 line break before binary operator
# W504 line break after binary operator
ignore = W503,W504
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,releasenotes
[hacking]
import_exceptions = karbor.i18n
[testenv:lower-constraints]
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt