2017-06-08 14:01:02 -07:00
|
|
|
[tox]
|
|
|
|
minversion = 1.6
|
|
|
|
skipsdist = True
|
2017-07-17 16:54:29 -04:00
|
|
|
envlist = linters
|
2020-05-09 13:44:32 -05:00
|
|
|
ignore_basepython_conflict = True
|
2017-06-08 14:01:02 -07:00
|
|
|
|
|
|
|
[testenv]
|
2017-07-19 12:35:34 -04:00
|
|
|
basepython = python3
|
2017-06-08 14:01:02 -07:00
|
|
|
install_command = pip install {opts} {packages}
|
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2018-06-28 16:26:54 -07:00
|
|
|
commands = stestr run {posargs}
|
|
|
|
stestr slowest
|
2017-06-08 14:01:02 -07:00
|
|
|
|
2018-08-17 10:16:37 +10:00
|
|
|
[testenv:py27]
|
|
|
|
basepython = python2.7
|
|
|
|
|
2017-06-08 14:01:02 -07:00
|
|
|
[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.
|
|
|
|
deps = bindep
|
|
|
|
commands = bindep test
|
|
|
|
|
|
|
|
[testenv:docs]
|
2019-05-09 13:58:13 +00:00
|
|
|
deps =
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2018-08-21 21:12:22 +02:00
|
|
|
commands =
|
|
|
|
sphinx-build -E -W -d doc/build/doctrees -b html doc/source/ doc/build/html
|
2017-06-08 14:01:02 -07:00
|
|
|
|
2017-07-17 16:54:29 -04:00
|
|
|
[testenv:linters]
|
2017-10-27 07:17:19 +02:00
|
|
|
passenv =
|
|
|
|
# NOTE(pabelanger): if you'd like to run tox -elinters locally, you'll need
|
|
|
|
# to export ANSIBLE_ROLES_PATH pointing to the currect repos.
|
2018-03-28 22:44:50 +02:00
|
|
|
# see openstack-zuul-jobs-linters job for more information.
|
2017-10-27 07:17:19 +02:00
|
|
|
ANSIBLE_ROLES_PATH
|
2018-10-01 14:02:45 -05:00
|
|
|
setenv =
|
2020-03-11 14:45:55 -05:00
|
|
|
ANSIBLE_LIBRARY= {toxinidir}/tests/fake-ansible
|
2017-06-08 14:01:02 -07:00
|
|
|
whitelist_externals = bash
|
|
|
|
commands =
|
|
|
|
flake8 {posargs}
|
2020-05-03 11:48:31 +01:00
|
|
|
yamllint -s -f parsable .
|
2019-12-23 15:39:26 -06:00
|
|
|
bash -c "find playbooks -type f -regex '.*.ya?ml' ! -regex '.*vars\/.*' -print0 | \
|
2020-04-23 13:58:43 +01:00
|
|
|
xargs -t -0 ansible-lint"
|
2020-04-21 13:25:27 +01:00
|
|
|
bash -c 'find roles -maxdepth 1 -mindepth 1 -type d | \
|
2020-04-23 13:58:43 +01:00
|
|
|
xargs -t ansible-lint'
|
2017-07-18 10:48:54 -04:00
|
|
|
# Ansible Syntax Check
|
2019-12-23 15:39:26 -06:00
|
|
|
bash -c "find playbooks -type f -regex '.*.ya?ml' ! -regex '.*vars\/.*' -exec \
|
2017-10-28 16:56:30 +02:00
|
|
|
ansible-playbook --syntax-check -i {toxinidir}/tests/inventory \{\} + > /dev/null"
|
2019-03-22 15:26:41 -07:00
|
|
|
{toxinidir}/tools/check_jobs_documented.py
|
2020-01-15 16:22:48 +00:00
|
|
|
{toxinidir}/tools/update-test-platforms.py
|
2020-04-20 13:47:51 +02:00
|
|
|
bash -c "(( $(find playbooks -name *.yml | wc -l) == 0)) || \{ echo 'Use .yaml'; exit 1; \}"
|
|
|
|
bash -c "(( $(find roles -name *.yml | wc -l) == 0)) || \{ echo 'Use .yaml'; exit 1; \}"
|
2020-04-23 13:58:43 +01:00
|
|
|
bash -c "git diff --quiet || \{ git status --porcelain; echo 'ERROR: git in dirty status, reporting as failure'; exit 1; \}"
|
2017-06-08 14:01:02 -07:00
|
|
|
|
|
|
|
[testenv:venv]
|
|
|
|
commands = {posargs}
|
|
|
|
|
|
|
|
[flake8]
|
2020-05-18 12:33:51 -07:00
|
|
|
# These are ignored intentionally in Zuul projects;
|
2017-06-08 14:01:02 -07:00
|
|
|
# please don't submit patches that solely correct them or enable them.
|
2017-09-02 14:15:24 -05:00
|
|
|
# E402 - ansible modules put documentation before imports. Align to ansible.
|
2018-10-25 08:09:28 +02:00
|
|
|
# W504 - line break after binary operator, we cannot have both
|
|
|
|
# W503 and W504 enabled
|
2020-05-18 12:33:51 -07:00
|
|
|
ignore = E124,E125,E129,E252,E402,E741,W503,W504,H
|
2017-06-08 14:01:02 -07:00
|
|
|
show-source = True
|
2019-11-19 08:40:32 -08:00
|
|
|
exclude =
|
|
|
|
.venv,
|
|
|
|
.tox,
|
|
|
|
dist,
|
|
|
|
doc,
|
|
|
|
build,
|
|
|
|
*.egg,
|
|
|
|
# vendored files
|
|
|
|
roles/use-buildset-registry/module_utils/pytoml.py,
|
2020-02-07 09:56:20 +11:00
|
|
|
roles/use-buildset-registry/module_utils/remarshal.py
|
|
|
|
|
|
|
|
[testenv:update-test-platforms]
|
|
|
|
basepython = python3
|
|
|
|
deps =
|
|
|
|
ruamel.yaml>=0.16.7
|
|
|
|
commands =
|
|
|
|
python ./tools/update-test-platforms.py
|