Files
Gustavo Herzmann 97c94787a3 Create Zuul job for unit test coverage
Creates a non-voting Zuul job that runs the tox coverage test.
Current coverage is 75%, so it's configured to fail if less than 75%.
This value should be updated whenever the coverage increases.

The full coverage report is copied to the zuul logs folder, providing
an easy way to view and share the results.

Test plan:
1. PASS: Verify that Zuul runs the new job and that the reports are
   copied to the Zuul log output folder.

Story: 2011149
Task: 53657

Co-Authored-By: Raphael <Raphael.Lima@windriver.com>

Change-Id: I93b254a587a052e0f890799ed9d7f969915a91a2
Signed-off-by: Gustavo Herzmann <gustavo.herzmann@windriver.com>
2026-01-14 08:45:17 -03:00

76 lines
2.2 KiB
INI

[tox]
envlist = linters
minversion = 2.3
skipsdist = True
[testenv]
basepython = python3
install_command = pip install \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
{opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
CURRENT_CFG_FILE={toxinidir}/.current.cfg
commands = find {toxinidir} -type f -not -path '{toxinidir}/.tox/*' -not -path '*/__pycache__/*' -name '*.py[c|o]' -delete
allowlist_externals =
rm
find
reno
[testenv:pep8]
description = Dummy environment to allow pep8 to be run in subdir tox
[testenv:pylint]
description = Dummy environment to allow pylint to be run in subdir tox
[testenv:black]
description = Dummy environment to allow black to be run in subdir tox
[testenv:black_check]
description = Dummy environment to allow black_check to be run in subdir tox
[testenv:cover]
description = Dummy environment to allow cover to be run in subdir tox
[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build
sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html
[testenv:releasenotes]
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:newnote]
# Re-use the releasenotes venv
envdir = {toxworkdir}/releasenotes
deps = -r{toxinidir}/doc/requirements.txt
commands = reno --rel-notes-dir {toxinidir}/releasenotes new {posargs}
[testenv:api-ref]
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[testenv:bandit]
description = Bandit code scan for *.py files under config folder
deps = bandit
commands = bandit -r {toxinidir}/ -x '**/.tox/**,**/.eggs/**' -lll
[testenv:linters]
allowlist_externals = bash
deps = yamllint
commands =
bash -c "find {toxinidir} \
\( -name .tox -prune \) \
-o -type f -name '*.yaml' \
-print0 | xargs -0 yamllint"