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