Files
Takashi Kajinami 9cd3c69fb7 Add real functional tests
Introduce a few test cases which uses actual devstack environment.
This allows us to detect problems hidden by mocking openstacksdk in
unit tests.

Change-Id: I2e97180aef68bbb06342a4ec8060bf714fbfc539
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
2026-10-25 01:41:34 +09:00

96 lines
1.9 KiB
INI

[tox]
minversion = 4.28.0
envlist = py3,pep8,docs
[testenv]
setenv =
OS_STDOUT_CAPTURE=true
OS_STDERR_CAPTURE=true
OS_LOG_CAPTURE=true
PYTHONDONTWRITEBYTECODE=1
passenv =
OS_*
constraints =
{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
deps =
-r{toxinidir}/test-requirements.txt
commands =
stestr run {posargs}
stestr slowest
[testenv:pep8]
description =
Run style checks.
deps =
pre-commit>=2.6.0 # MIT
{[testenv:mypy]deps}
commands =
pre-commit run -a
{[testenv:mypy]commands}
[testenv:mypy]
description =
Run type checks.
deps =
{[testenv]deps}
mypy
commands =
mypy --cache-dir="{envdir}/mypy_cache" {posargs:oslo_limit}
[testenv:functional]
setenv =
{[testenv]setenv}
OS_TEST_PATH=./oslo_limit/tests/functional
[testenv:venv]
commands = {posargs}
[testenv:debug]
commands = oslo_debug_helper -t oslo_limit/tests {posargs}
[testenv:docs]
deps =
-r{toxinidir}/doc/requirements.txt
allowlist_externals = rm
commands =
rm -fr doc/build
sphinx-build -W --keep-going -b html doc/source doc/build/html
[testenv:cover]
setenv =
{[testenv]setenv}
PYTHON=coverage run --source oslo_limit --parallel-mode
deps =
{[testenv]deps}
coverage>=5.0 # Apache-2.0
commands =
coverage erase
{[testenv]commands}
coverage combine
coverage html -d cover
coverage report
[testenv:releasenotes]
skip_install = true
allowlist_externals = rm
deps = {[testenv:docs]deps}
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
[flake8]
show-source = true
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
# We only enable the hacking (H) checks
select = H
# H301 Black will put commas after imports that can't fit on one line
# H405 Multi-line docstrings are fine
ignore = H301,H405
[hacking]
import_exceptions =
collections
types
typing
oslo_limit._i18n