2018-06-11 18:50:11 -05:00
|
|
|
[tox]
|
2018-09-04 09:57:48 +08:00
|
|
|
envlist = linters,pep8
|
2018-06-11 18:50:11 -05:00
|
|
|
minversion = 2.3
|
|
|
|
skipsdist = True
|
|
|
|
|
|
|
|
[testenv]
|
2019-06-25 13:20:35 -04:00
|
|
|
install_command = pip install \
|
|
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \
|
|
|
|
{opts} {packages}
|
2018-06-11 18:50:11 -05:00
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
|
|
OS_STDOUT_CAPTURE=1
|
|
|
|
OS_STDERR_CAPTURE=1
|
|
|
|
OS_TEST_TIMEOUT=60
|
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2018-09-03 07:08:30 -05:00
|
|
|
whitelist_externals = reno
|
2018-06-11 18:50:11 -05:00
|
|
|
|
|
|
|
[testenv:linters]
|
2018-10-05 10:53:59 +00:00
|
|
|
basepython = python3
|
2018-06-11 18:50:11 -05:00
|
|
|
whitelist_externals = bash
|
2018-08-28 16:07:12 +08:00
|
|
|
#bashate ignore errors
|
|
|
|
#E010: do not on the same line as for
|
|
|
|
#E006 Line too long
|
2018-06-11 18:50:11 -05:00
|
|
|
commands =
|
|
|
|
bash -c "find {toxinidir} \
|
|
|
|
-not \( -type d -name .?\* -prune \) \
|
|
|
|
-type f \
|
|
|
|
-not -name \*~ \
|
|
|
|
-not -name \*.md \
|
2019-02-04 13:49:14 -06:00
|
|
|
\( \
|
|
|
|
-name \*.sh \
|
|
|
|
-or -not -wholename \*/devstack/files/\* \
|
|
|
|
-wholename \*/devstack/\* \
|
|
|
|
\) \
|
2018-11-23 14:05:44 -05:00
|
|
|
-print0 | xargs -n 1 -0 bashate -v -i E010,E006"
|
2018-06-11 18:50:11 -05:00
|
|
|
bash -c "find {toxinidir} \
|
|
|
|
\( -name middleware/io-monitor/recipes-common/io-monitor/io-monitor/io_monitor/test-tools/yaml/* -prune \) \
|
|
|
|
-o \( -name .tox -prune \) \
|
|
|
|
-o -type f -name '*.yaml' \
|
|
|
|
-print0 | xargs -0 yamllint"
|
|
|
|
|
2019-12-23 10:49:58 -06:00
|
|
|
[testenv:pylint]
|
|
|
|
basepython = python3
|
|
|
|
usedevelop = False
|
|
|
|
description =
|
|
|
|
Pylint check
|
|
|
|
deps = {[testenv]deps}
|
|
|
|
redfish
|
|
|
|
pylint
|
|
|
|
commands =
|
|
|
|
pylint {posargs} --rcfile=./pylint.rc \
|
|
|
|
tools/rvmc/centos/docker/rvmc.py \
|
|
|
|
mtce/src/hwmon/scripts/hwmond_notify.py
|
|
|
|
|
2018-06-11 18:50:11 -05:00
|
|
|
[testenv:pep8]
|
2018-10-05 10:53:59 +00:00
|
|
|
basepython = python3
|
2018-06-11 18:50:11 -05:00
|
|
|
usedevelop = False
|
|
|
|
deps =
|
2018-10-24 10:07:57 -05:00
|
|
|
flake8<3.6.0
|
2018-09-04 09:57:48 +08:00
|
|
|
description =
|
|
|
|
Run style checks
|
2018-06-11 18:50:11 -05:00
|
|
|
commands =
|
2018-09-04 09:57:48 +08:00
|
|
|
flake8
|
2019-04-22 15:40:23 -04:00
|
|
|
# hacking can be added for additional pep8 once this passes for all metal
|
2018-06-11 18:50:11 -05:00
|
|
|
|
2018-09-04 09:57:48 +08:00
|
|
|
[flake8]
|
|
|
|
show-source = True
|
|
|
|
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,release-tag-*
|
2018-11-23 14:05:44 -05:00
|
|
|
# H102 Apache License format
|
2019-06-10 13:06:24 -04:00
|
|
|
ignore = H102
|
2018-11-23 14:05:44 -05:00
|
|
|
|
2018-06-11 18:50:11 -05:00
|
|
|
[testenv:venv]
|
|
|
|
commands = {posargs}
|
2018-08-08 15:48:19 -05:00
|
|
|
|
|
|
|
[testenv:docs]
|
|
|
|
basepython = python3
|
|
|
|
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
|
|
|
|
whitelist_externals = rm
|
2018-09-03 07:08:30 -05:00
|
|
|
|
|
|
|
[testenv:releasenotes]
|
|
|
|
basepython = python3
|
|
|
|
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
|
|
|
|
whitelist_externals = rm
|
2018-08-08 16:35:41 -05:00
|
|
|
|
2018-09-04 15:12:02 -05:00
|
|
|
[testenv:newnote]
|
2018-10-05 10:53:59 +00:00
|
|
|
basepython = python3
|
2018-09-04 15:12:02 -05:00
|
|
|
# Re-use the releasenotes venv
|
|
|
|
envdir = {toxworkdir}/releasenotes
|
|
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
|
|
commands = reno new {posargs}
|
|
|
|
|
2018-08-08 16:35:41 -05:00
|
|
|
[testenv:api-ref]
|
|
|
|
basepython = python3
|
|
|
|
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
|
|
|
|
whitelist_externals = rm
|
2019-02-04 13:49:14 -06:00
|
|
|
|
|
|
|
[testenv:functional]
|
|
|
|
basepython = python3
|
|
|
|
whitelist_externals = cat
|
|
|
|
commands = cat /etc/mtc.ini
|
2020-05-04 16:47:45 +02:00
|
|
|
|
|
|
|
[testenv:bandit]
|
|
|
|
basepython = python3
|
|
|
|
description = Bandit code scan for *.py files under config folder
|
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
|
|
commands = bandit -r {toxinidir}/ -x '**/.tox/**,**/.eggs/**' -lll
|