Michel Thebeau 4eba315b7e add libvirt to tox.ini pylint
Story: 2010816
Task: 48394

Test Plan:
PASS: add errors in libvirt bash and py files and observe tox output

Change-Id: Ie8baba41075360044859dc3c60f44d9411f5cb10
Signed-off-by: Michel Thebeau <Michel.Thebeau@windriver.com>
2023-07-14 17:18:36 -04:00

54 lines
1.7 KiB
INI

[tox]
envlist = linters,pylint,unittests
minversion = 2.3
skipsdist = True
[testenv]
deps = -r{toxinidir}/requirements/test-requirements.txt
allowlist_externals = reno
[testenv:linters]
basepython = python3
# bashate ignore:
# E006 - accept long lines
# E040 - false positive on |& syntax (new in bash 4)
allowlist_externals = bash
commands =
bash -c "find {toxinidir} \
\( -name .tox -prune \) \
-o -type f -name '*.yaml' \
-not \( -type f -path *template* -prune \) \
-print0 | xargs -0 yamllint"
bash -c "find {toxinidir} \
-not \( -type d -name .?\* -prune \) \
-type f \
-not -name \*~ \
-not -name \*.md \
-name \*.sh \
-print0 | xargs -0 bashate -v -iE006,E040"
[testenv:pylint]
basepython = python3
sitepackages = False
setenv =
BASEPATH = {toxinidir}/virtualbox/pybox
PYTHONPATH= {env:BASEPATH}:{env:BASEPATH}/helper:{env:BASEPATH}/consts:{env:BASEPATH}/utils
deps =
-r{env:BASEPATH}/requirements.txt
{[testenv]deps}
allowlist_externals = pylint
commands = pylint {posargs} --rcfile=./pylint.rc virtualbox/pybox libvirt
[testenv:unittests]
basepython = python3
setenv =
BASEPATH = {toxinidir}/virtualbox/pybox
PYTHONPATH= {env:BASEPATH}:{env:BASEPATH}/helper:{env:BASEPATH}/consts:{env:BASEPATH}/utils
deps =
-r{toxinidir}/virtualbox/pybox/requirements.txt
coverage
change_dir = {env:BASEPATH}
commands =
coverage run -m unittest discover
coverage report -m