os-faults/tox.ini
Takashi Kajinami dff77df8fc Adapt to recent dependencies
This covers the following updates to fix CI currently broken.

* Fix compatibility with tox 4
* Update hacking to 6.1.0
* Clean up python 2 support and bump minimum supported version to 3.8
* Remove six because python 2 support is removed
* Update job template to use the recent tested python versions
* Replace items by prefixItems to fix schema error
* Build documentation by sphinx command
* Remove "Change Log" section from documentation
* Split requirements for documentation build
* Ensure tox is installed in functional tests
* Fix devstack job

Change-Id: I3b9c5b20aca55332c721d34fd4c41c5b886f60c5
2024-11-27 19:35:39 +01:00

79 lines
2.2 KiB
INI

[tox]
minversion = 3.18.0
envlist = pep8,py3,cover
ignore_basepython_conflict = 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]
allowlist_externals =
rm
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
-r{toxinidir}/requirements.txt
commands =
rm -rf doc/build
sphinx-build -W --keep-going -b html doc/source doc/build/html
[testenv:releasenotes]
deps = {[testenv:docs]deps}
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