Files
cinderlib/tox.ini
ricolin 25399dd3cf Fix unmaintained branch CI
Zed is now call `unmaintained/zed` not `stable/zed`
This is requred for unmaintained/zed CI in Cinder.

NOTE(elod.illes): cinderlib is retired, hence the repository is empty
on master branch, causing issues with build-openstack-releasenotes job,
which should run on master. To unblock the gate this job (actually,
release-notes-jobs-python3 job template) needs to be dropped.

NOTE(elod.illes): centos-8-stream nodeset is removed from zuul config,
let's replace it with centos-9-stream in cinderlib-lvm-functional as
that OS is still supported. Also, set it as non-voting in check queue
and remove from gate queue to not block the gate.

NOTE(elod.illes): the following patch is also incorporated to unblock
the gate: Cap setuptools <71.0.0

py38 jobs (on ubuntu-focal) started to fail (see the relevant github
issue [1]) due to recent virtualenv release (20.26.4; which bundles
setuptools).

setuptools is bundled in virtualenv, so it has to be capped via the
virtualenv package. tox also needed to be capped (<4) as gate uses
tox 3.28.0, but with capping virtualenv we pull in latest tox as well,
which would cause other errors.

[1] https://github.com/pypa/setuptools/issues/4483

Conflicts:
  tox.ini

Change-Id: If769d9da92b724d40f47c9a57a75c021809c8850
(cherry picked from commit 6210535b90)
(cherry picked from commit 6ad87cbbe8)
(cherry picked from commit 1546df9246)
(cherry picked from commit 592cc260c9)
2025-02-04 21:46:53 +01:00

164 lines
5.2 KiB
INI

[tox]
minversion = 3.1
# python runtimes: https://governance.openstack.org/tc/reference/project-testing-interface.html#tested-runtimes
envlist = py3,pep8
skipsdist = True
setenv = VIRTUAL_ENV={envdir}
# this allows tox to infer the base python from the environment name
# and override any basepython configured in this file
ignore_basepython_conflict=true
# Cap setuptools via virtualenv to prevent compatibility issue with yoga
# branch's upper constraint of 'packaging' package (21.3).
requires =
virtualenv<20.26.4
tox<4
setuptools<71.0.0
[testenv]
basepython=python3
setenv = OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
OS_TEST_PATH=./cinderlib/tests/unit
usedevelop=True
install_command = pip install {env:PIP_OPTIONS:} {opts} {packages}
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/victoria}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
commands =
find . -ignore_readdir_race -type f -name "*.pyc" -delete
stestr run {posargs}
stestr slowest
whitelist_externals =
bash
find
passenv = *_proxy *_PROXY
[testenv:functional]
usedevelop=True
passenv = CL_FTEST_POOL_NAME
setenv = OS_TEST_PATH=./cinderlib/tests/functional
CL_FTEST_CFG={env:CL_FTEST_CFG:{toxinidir}/cinderlib/tests/functional/lvm.yaml}
CL_FTEST_ROOT_HELPER={env:CL_FTEST_ROOT_HELPER:{toxinidir}/tools/virtualenv-sudo.sh}
sitepackages = True
# Not reusing py37's env due to https://github.com/tox-dev/tox/issues/477
# envdir = {toxworkdir}/py37
# Must run serially or test_stats_with_creation may fail occasionally
commands =
find . -ignore_readdir_race -type f -name "*.pyc" -delete
# run stestr through python -m so that the python from the virtualenv
# is used; stestr's shebang may point to system python, thus breaking
# the lookup of modules from the venv.
python -m stestr run --serial {posargs}
python -m stestr slowest
whitelist_externals =
find
stestr
[testenv:functional-py36]
usedevelop=True
setenv =
{[testenv:functional]setenv}
sitepackages = True
basepython=python3.6
# Not reusing py36's env due to https://github.com/tox-dev/tox/issues/477
# envdir = {toxworkdir}/py36
commands = {[testenv:functional]commands}
whitelist_externals = {[testenv:functional]whitelist_externals}
[testenv:functional-py38]
usedevelop=True
setenv =
{[testenv:functional]setenv}
sitepackages = True
basepython=python3.8
# Not reusing py38's env due to https://github.com/tox-dev/tox/issues/477
# envdir = {toxworkdir}/py38
commands = {[testenv:functional]commands}
whitelist_externals = {[testenv:functional]whitelist_externals}
[testenv:releasenotes]
# Not reusing doc's env due to https://github.com/tox-dev/tox/issues/477
# envdir = {toxworkdir}/docs
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/victoria}
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:docs]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/victoria}
-r{toxinidir}/doc/requirements.txt
commands =
doc8 --ignore D001 --ignore-path .tox --ignore-path *.egg-info --ignore-path doc/build --ignore-path .eggs/*/EGG-INFO/*.txt -e txt -e rst
rm -rf doc/build .autogenerated doc/source/api
sphinx-build -W -b html doc/source doc/build/html
rm -rf api-ref/build
whitelist_externals = rm
[testenv:pdf-docs]
deps =
{[testenv:docs]deps}
commands =
{[testenv:docs]commands}
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
cp doc/build/pdf/doc-cinderlib.pdf doc/build/html
whitelist_externals =
{[testenv:docs]whitelist_externals}
make
cp
[testenv:bindep]
# Do not install any requirements. We want this to be fast and work even if
# system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed
# separately, outside of the requirements files, and develop mode disabled
# explicitly to avoid unnecessarily installing the checked-out repo too (this
# further relies on "tox.skipsdist = True" above).
deps = bindep
commands = bindep {posargs}
usedevelop = False
[testenv:pylint]
deps = -r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
pylint==2.1.1
commands =
bash ./tools/coding-checks.sh --pylint {posargs}
[testenv:cover]
# Also do not run test_coverage_ext tests while gathering coverage as those
# tests conflict with coverage.
setenv =
{[testenv]setenv}
PYTHON=coverage run --source cinderlib --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[flake8]
# see comment in cinderlib/cinderlib.py for why we need to ignore E402
# (import order) in these files
per-file-ignores =
cinderlib/cinderlib.py:E402
cinderlib/cmd/cinder_to_yaml.py:E402
[testenv:pep8]
commands=flake8 {posargs} .
deps=
-r{toxinidir}/test-requirements.txt
[testenv:fast8]
# Not reusing Flake8's env due to https://github.com/tox-dev/tox/issues/477
# envdir = {toxworkdir}/flake8
commands={toxinidir}/tools/fast8.sh
passenv = FAST8_NUM_COMMITS