70 lines
2.1 KiB
INI
70 lines
2.1 KiB
INI
[tox]
|
|
minversion = 2.6
|
|
envlist = pep8,py27,py36,cover
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
install_command = pip install -U {opts} {packages}
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
whitelist_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]
|
|
basepython = python3
|
|
commands = flake8 . doc/ext
|
|
|
|
[testenv:venv]
|
|
basepython = python3
|
|
commands = {posargs}
|
|
|
|
[testenv:cover]
|
|
basepython = python3
|
|
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
|
|
basepython = python3
|
|
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]
|
|
basepython = python3
|
|
commands =
|
|
rm -rf doc/build
|
|
python setup.py build_sphinx --warning-is-error
|
|
|
|
[testenv:releasenotes]
|
|
basepython = python3
|
|
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
|
|
ignore = E123,E125,E731
|
|
show-source = True
|
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|