
Add support for tox testing under Debian Bullseye by enabling a python3.9 gate and tox target for exercsing unit tests. Story: 2009101 Task: 43187 Signed-off-by: Charles Short <charles.short@windriver.com> Change-Id: Id00936d92962e50221ebfe714307e96ecbc4e043
143 lines
3.8 KiB
INI
143 lines
3.8 KiB
INI
[tox]
|
|
envlist = flake8,py27,py36,py39,pylint,bandit
|
|
minversion = 1.6
|
|
# skipsdist = True
|
|
#,pip-missing-reqs
|
|
|
|
# tox does not work if the path to the workdir is too long, so move it to /tmp
|
|
toxworkdir = /tmp/{env:USER}_k8sportieristox
|
|
stxdir = {toxinidir}/../../..
|
|
distshare={toxworkdir}/.tox/distshare
|
|
|
|
[testenv]
|
|
# usedevelop = True
|
|
# enabling usedevelop results in py27 develop-inst:
|
|
# Exception: Versioning for this project requires either an sdist tarball,
|
|
# or access to an upstream git repository.
|
|
sitepackages = False
|
|
|
|
# tox is silly... these need to be separated by a newline....
|
|
whitelist_externals = bash
|
|
find
|
|
|
|
install_command = pip install \
|
|
-v -v -v --use-deprecated legacy-resolver \
|
|
-c{toxinidir}/upper-constraints.txt \
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \
|
|
{opts} {packages}
|
|
|
|
# Note the hash seed is set to 0 until can be tested with a
|
|
# random hash seed successfully.
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
PYTHONHASHSEED=0
|
|
PYTHONDONTWRITEBYTECODE=1
|
|
OS_TEST_PATH=./k8sapp_portieris/tests
|
|
LANG=en_US.UTF-8
|
|
LANGUAGE=en_US:en
|
|
LC_ALL=C
|
|
EVENTS_YAML=./k8sapp_portieris/tests/events_for_testing.yaml
|
|
SYSINV_TEST_ENV=True
|
|
TOX_WORK_DIR={toxworkdir}
|
|
PYLINTHOME={toxworkdir}
|
|
|
|
deps = -r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
-e{[tox]stxdir}/config/sysinv/sysinv/sysinv
|
|
-e{[tox]stxdir}/config/tsconfig/tsconfig
|
|
-e{[tox]stxdir}/fault/fm-api
|
|
-e{[tox]stxdir}/fault/python-fmclient/fmclient
|
|
-e{[tox]stxdir}/utilities/ceph/python-cephclient/python-cephclient
|
|
-e{[tox]stxdir}/update/cgcs-patch/cgcs-patch
|
|
|
|
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
|
|
[flake8]
|
|
exclude = build,dist,tools,.eggs
|
|
max-line-length=120
|
|
|
|
[testenv:flake8]
|
|
basepython = python3
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
flake8-bugbear
|
|
commands =
|
|
flake8 {posargs} .
|
|
|
|
[testenv:py27]
|
|
basepython = python2.7
|
|
commands =
|
|
{[testenv]commands}
|
|
stestr run {posargs}
|
|
stestr slowest
|
|
|
|
[testenv:py39]
|
|
basepython = python3.9
|
|
install_command = pip install \
|
|
-v -v -v --use-deprecated legacy-resolver \
|
|
-c{toxinidir}/upper-constraints.txt \
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
|
|
{opts} {packages}
|
|
commands =
|
|
{[testenv]commands}
|
|
stestr run {posargs}
|
|
stestr slowest
|
|
|
|
[testenv:py36]
|
|
basepython = python3.6
|
|
commands =
|
|
{[testenv]commands}
|
|
stestr run {posargs}
|
|
stestr slowest
|
|
|
|
[testenv:pep8]
|
|
# testenv:flake8 clone
|
|
basepython = {[testenv:flake8]basepython}
|
|
deps = {[testenv:flake8]deps}
|
|
commands = {[testenv:flake8]commands}
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[bandit]
|
|
|
|
[testenv:bandit]
|
|
basepython = python3
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
bandit
|
|
|
|
commands = bandit --ini tox.ini -n 5 -r k8sapp_portieris
|
|
|
|
[testenv:pylint]
|
|
basepython = python2.7
|
|
sitepackages = False
|
|
|
|
deps = {[testenv]deps}
|
|
pylint
|
|
commands =
|
|
pylint {posargs} k8sapp_portieris --rcfile=./pylint.rc
|
|
|
|
[testenv:cover]
|
|
basepython = python2.7
|
|
deps = {[testenv]deps}
|
|
setenv = {[testenv]setenv}
|
|
PYTHON=coverage run --parallel-mode
|
|
|
|
commands =
|
|
{[testenv]commands}
|
|
coverage erase
|
|
stestr run {posargs}
|
|
coverage combine
|
|
coverage html -d cover
|
|
coverage xml -o cover/coverage.xml
|
|
coverage report
|
|
|
|
[testenv:pip-missing-reqs]
|
|
# do not install test-requirements as that will pollute the virtualenv for
|
|
# determining missing packages
|
|
# this also means that pip-missing-reqs must be installed separately, outside
|
|
# of the requirements.txt files
|
|
deps = pip_missing_reqs
|
|
-rrequirements.txt
|
|
commands=pip-missing-reqs -d --ignore-file=/k8sapp_portieris/tests k8sapp_portieris
|