os-faults/tox.ini

72 lines
2.0 KiB
INI

[tox]
minversion = 3.18.0
envlist = pep8,py3,cover
skipsdist = True
[testenv]
basepython = python3
usedevelop = True
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
setenv =
VIRTUAL_ENV={envdir}
allowlist_externals =
find
rm
commands =
find . -type f -name "*.pyc" -delete
py.test -vvvv --html={envlogdir}/pytest_results.html --self-contained-html --durations=10 "os_faults/tests/unit" {posargs}
passenv =
http_proxy
HTTP_PROXY
https_proxy
HTTPS_PROXY
no_proxy
NO_PROXY
[testenv:pep8]
commands = flake8 . doc/ext
[testenv:venv]
commands = {posargs}
[testenv:cover]
commands =
py.test --cov-config .coveragerc --cov-report html --cov=os_faults "os_faults/tests/unit"
coverage html -d {envlogdir}
coverage report
[testenv:devstack]
# to execute the tests:
# 1) create SSH key in os-faults folder: ssh-keygen -t rsa -f os_faults_key -N ''
# 2) copy public key into authorized_keys of user stack: cat os_faults_key.pub >> ~/.ssh/authorized_keys
# 3) run tests normally: tox -e devstack
setenv = {[testenv]setenv}
OS_TEST_PATH=./os_faults/tests/devstack
OS_DEBUG=True
deps = {[testenv]deps}
extras =
commands =
py.test -vvvv --html={envlogdir}/pytest_results.html --self-contained-html --durations=10 "os_faults/tests/devstack" {posargs}
[testenv:docs]
commands =
rm -rf doc/build
python setup.py build_sphinx --warning-is-error
[testenv:releasenotes]
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8]
# E123 skipped because it is ignored by default in the default pep8.
# E125 skipped until https://github.com/jcrocholl/pep8/issues/126 is resolved.
# E731 skipped as assign a lambda expression
# W503 line break before binary operator
# W504 line break after binary operator
ignore = E123,E125,E731,W503,W504
show-source = True
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build