Files
Takashi Kajinami 84443c7171 Capture outputs and logs
... to reduce verbosity of test outputs.

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

125 lines
2.8 KiB
INI

[tox]
minversion = 4.28.0
envlist = py3, pep8
[testenv]
setenv =
OS_STDOUT_CAPTURE=true
OS_STDERR_CAPTURE=true
OS_LOG_CAPTURE=true
PYTHONDONTWRITEBYTECODE=1
passenv =
OS_*
ZUUL_CACHE_DIR
REQUIREMENTS_PIP_LOCATION
RABBITMQ_LOGS
constraints =
{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
deps =
-r{toxinidir}/test-requirements.txt
extras =
eventlet
kafka
commands =
stestr run --slowest {posargs}
# TODO(tkajinm): Remove this when py315 wheel of confluent-kafka is published
# https://github.com/confluentinc/confluent-kafka-python/issues/2299
[testenv:py315]
extras =
[testenv:pep8]
skip_install = true
deps =
pre-commit>=2.6.0 # MIT
commands =
pre-commit run -a
[testenv:cover]
setenv =
{[testenv]setenv}
PYTHON=coverage run
deps =
{[testenv]deps}
coverage>=5.0 # Apache-2.0
commands =
coverage erase
{[testenv]commands}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:venv]
commands = {posargs}
[testenv:docs]
allowlist_externals =
rm
deps =
{[testenv]deps}
-r{toxinidir}/doc/requirements.txt
commands =
rm -fr doc/build
sphinx-build -W --keep-going -b html doc/source doc/build/html
# The following functional test scenarios are defined for the
# testing of the messaging backends and to demonstrated the functional
# correctness across driver combinations (e.g. RPC and Notify)
#
# RPC Notify
# -------- --------
# scenario01 rabbit rabbit
# scenario02 rabbit kafka
#
[testenv:py311-func-scenario01]
setenv =
{[testenv]setenv}
SCENARIO=scenario01
allowlist_externals =
{toxinidir}/tools/setup-scenario-env.sh
commands =
{toxinidir}/tools/setup-scenario-env.sh stestr run --slowest {posargs:oslo_messaging.tests.functional}
[testenv:py311-func-scenario02]
setenv =
{[testenv]setenv}
SCENARIO=scenario02
allowlist_externals =
{toxinidir}/tools/setup-scenario-env.sh
commands =
{toxinidir}/tools/setup-scenario-env.sh stestr run --slowest {posargs:oslo_messaging.tests.functional}
[flake8]
show-source = True
# H904: Delay string interpolations at logging calls
enable-extensions = H203,H106,H904
# We only enable the hacking (H) checks
select = H
ignore = H405
exclude = .tox,dist,doc,*.egg,build,__init__.py
[hacking]
import_exceptions =
[flake8:local-plugins]
extension =
O324 = checks:CheckForLoggingIssues
paths = ./oslo_messaging/hacking
[testenv:releasenotes]
skip_install = true
allowlist_externals =
rm
deps =
-r{toxinidir}/doc/requirements.txt
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
[testenv:bindep]
skip_install = true
deps =
bindep
commands = bindep {posargs}