2017-02-13 20:56:05 -06:00
|
|
|
[tox]
|
2017-08-10 01:22:21 +00:00
|
|
|
skipsdist = True
|
2018-08-11 23:12:32 -05:00
|
|
|
minversion = 2.3.1
|
2018-06-06 03:25:26 -05:00
|
|
|
envlist = py35, pep8, cover, bandit
|
2017-02-13 20:56:05 -06:00
|
|
|
|
|
|
|
[testenv]
|
|
|
|
deps=
|
2018-02-02 16:20:58 -06:00
|
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2017-11-22 13:40:08 -06:00
|
|
|
passenv=HTTP_PROXY HTTPS_PROXY http_proxy https_proxy NO_PROXY no_proxy
|
2017-02-13 20:56:05 -06:00
|
|
|
setenv=
|
2017-08-10 01:22:21 +00:00
|
|
|
VIRTUAL_ENV={envdir}
|
|
|
|
usedevelop = True
|
2017-09-12 03:11:57 +00:00
|
|
|
install_command = pip install {opts} {packages}
|
2018-02-02 16:20:58 -06:00
|
|
|
whitelist_externals =
|
2018-10-14 17:52:32 -04:00
|
|
|
bash
|
2018-02-02 16:20:58 -06:00
|
|
|
find
|
2018-03-20 15:49:13 +00:00
|
|
|
rm
|
2017-08-10 01:22:21 +00:00
|
|
|
commands =
|
2018-02-02 16:20:58 -06:00
|
|
|
find . -type f -name "*.pyc" -delete
|
2018-06-08 16:31:03 -04:00
|
|
|
rm -Rf .testrepository/times.dbm
|
|
|
|
|
2018-08-24 21:23:29 +02:00
|
|
|
[testenv:venv]
|
|
|
|
basepython=python3
|
|
|
|
commands =
|
|
|
|
{posargs}
|
|
|
|
|
2018-06-08 16:31:03 -04:00
|
|
|
[testenv:py35]
|
2018-08-11 23:12:32 -05:00
|
|
|
basepython = python3.5
|
2018-06-08 16:31:03 -04:00
|
|
|
commands =
|
|
|
|
{[testenv]commands}
|
|
|
|
stestr run {posargs}
|
|
|
|
stestr slowest
|
2017-03-12 09:22:29 -05:00
|
|
|
|
2018-06-27 15:24:56 +07:00
|
|
|
[testenv:py36]
|
2018-08-11 23:12:32 -05:00
|
|
|
basepython = python3.6
|
2018-06-27 15:24:56 +07:00
|
|
|
commands =
|
|
|
|
{[testenv]commands}
|
|
|
|
stestr run {posargs}
|
|
|
|
stestr slowest
|
|
|
|
|
2017-05-03 09:52:46 -05:00
|
|
|
[testenv:docs]
|
2018-06-08 13:51:02 +08:00
|
|
|
basepython = python3
|
2018-05-18 18:30:30 -05:00
|
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
2017-08-10 01:22:21 +00:00
|
|
|
commands =
|
2018-03-02 16:51:09 -06:00
|
|
|
rm -rf doc/build
|
2018-05-18 18:30:30 -05:00
|
|
|
sphinx-build -W -b html doc/source doc/build/html
|
2017-05-03 09:52:46 -05:00
|
|
|
|
2017-06-16 11:59:22 -05:00
|
|
|
[testenv:genconfig]
|
2018-06-08 13:51:02 +08:00
|
|
|
basepython = python3
|
2017-08-10 01:22:21 +00:00
|
|
|
commands =
|
2018-02-02 16:20:58 -06:00
|
|
|
oslo-config-generator --config-file=etc/armada/config-generator.conf
|
2017-09-12 03:11:57 +00:00
|
|
|
|
|
|
|
[testenv:genpolicy]
|
2018-06-08 13:51:02 +08:00
|
|
|
basepython = python3
|
2017-09-12 03:11:57 +00:00
|
|
|
commands =
|
2018-02-02 16:20:58 -06:00
|
|
|
oslopolicy-sample-generator --config-file=etc/armada/policy-generator.conf
|
2017-05-03 09:52:46 -05:00
|
|
|
|
2018-05-18 20:37:04 -05:00
|
|
|
[testenv:releasenotes]
|
2018-06-08 13:51:02 +08:00
|
|
|
basepython = python3
|
2018-05-18 20:37:04 -05:00
|
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
2018-06-13 23:33:56 -05:00
|
|
|
commands =
|
2018-06-22 13:14:32 -05:00
|
|
|
rm -rf releasenotes/build
|
|
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
2018-05-18 20:37:04 -05:00
|
|
|
|
2017-08-10 01:22:21 +00:00
|
|
|
[testenv:pep8]
|
2018-06-08 13:51:02 +08:00
|
|
|
basepython = python3
|
2018-06-03 03:20:52 -05:00
|
|
|
deps =
|
2018-09-11 20:39:25 +00:00
|
|
|
yapf
|
2018-06-03 03:20:52 -05:00
|
|
|
.[bandit]
|
|
|
|
{[testenv]deps}
|
2017-08-10 01:22:21 +00:00
|
|
|
commands =
|
2018-10-14 17:52:32 -04:00
|
|
|
# Whitespace linter (for chart files)
|
|
|
|
bash {toxinidir}/tools/whitespace-linter.sh
|
2018-06-22 13:14:32 -05:00
|
|
|
yapf -dr {toxinidir}/armada {toxinidir}/setup.py
|
2018-02-02 16:20:58 -06:00
|
|
|
flake8 {posargs}
|
2018-06-03 03:20:52 -05:00
|
|
|
# Run security linter as part of the pep8 gate instead of a separate zuul job.
|
|
|
|
bandit -r armada -x armada/tests -n 5
|
2017-08-10 01:22:21 +00:00
|
|
|
|
|
|
|
[testenv:bandit]
|
2018-06-08 13:51:02 +08:00
|
|
|
basepython = python3
|
2017-08-10 01:22:21 +00:00
|
|
|
commands =
|
2018-02-02 16:20:58 -06:00
|
|
|
bandit -r armada -x armada/tests -n 5
|
2017-08-10 01:22:21 +00:00
|
|
|
|
2018-05-18 08:41:02 -04:00
|
|
|
[testenv:cover]
|
2018-06-08 13:51:02 +08:00
|
|
|
basepython = python3
|
2018-06-06 03:25:26 -05:00
|
|
|
setenv = {[testenv]setenv}
|
|
|
|
PYTHON=coverage run --source armada --parallel-mode
|
2017-08-10 01:22:21 +00:00
|
|
|
commands =
|
2018-06-22 13:14:32 -05:00
|
|
|
coverage erase
|
|
|
|
find . -type f -name "*.pyc" -delete
|
|
|
|
stestr run {posargs}
|
|
|
|
coverage combine
|
|
|
|
coverage html -d cover
|
|
|
|
coverage xml -o cover/coverage.xml
|
|
|
|
coverage report
|
|
|
|
|
|
|
|
[testenv:yapf]
|
|
|
|
basepython = python3
|
|
|
|
commands =
|
|
|
|
yapf -ir {toxinidir}/armada {toxinidir}/setup.py
|
2017-06-14 15:30:43 +00:00
|
|
|
|
2017-08-10 01:22:21 +00:00
|
|
|
[flake8]
|
2018-01-15 20:01:11 -05:00
|
|
|
filename = *.py
|
2018-10-26 08:08:46 +02:00
|
|
|
# These are ignored intentionally:
|
|
|
|
# W504 - line break after binary operator, we cannot have both
|
|
|
|
# W503 and W504 enabled
|
|
|
|
ignore = W504
|
2018-05-17 19:34:42 +01:00
|
|
|
exclude = .git,.tox,dist,*lib/python*,*egg,build,releasenotes,doc/*,hapi,venv
|