2012-06-11 11:07:14 +01:00
|
|
|
[tox]
|
2013-09-17 16:34:21 +00:00
|
|
|
minversion = 1.6
|
2015-12-22 10:15:21 +01:00
|
|
|
envlist = linters
|
2013-09-19 07:57:23 -07:00
|
|
|
skipsdist = True
|
2012-06-11 11:07:14 +01:00
|
|
|
|
2013-09-17 16:34:21 +00:00
|
|
|
[testenv]
|
2018-08-21 10:59:38 +10:00
|
|
|
basepython = python3
|
2013-09-19 07:57:23 -07:00
|
|
|
usedevelop = True
|
|
|
|
install_command = pip install {opts} {packages}
|
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2013-09-17 16:34:21 +00:00
|
|
|
|
2015-12-22 10:15:21 +01:00
|
|
|
[testenv:linters]
|
2017-01-12 15:32:46 -05:00
|
|
|
whitelist_externals = bash
|
2015-12-22 10:15:21 +01:00
|
|
|
commands =
|
|
|
|
flake8
|
|
|
|
{toxinidir}/tools/run-bashate.sh
|
2018-06-15 13:58:57 +10:00
|
|
|
python3 {toxinidir}/tools/sorted_modules_env.py {toxinidir}/modules.env
|
|
|
|
python3 {toxinidir}/tools/irc_checks.py
|
|
|
|
python3 {toxinidir}/tools/check_clouds_yaml.py
|
2018-11-01 15:31:44 +11:00
|
|
|
python3 -m unittest playbooks/roles/install-ansible/files/inventory_plugins/test_yamlgroup.py
|
2017-01-12 15:32:46 -05:00
|
|
|
# Ansible Lint Check
|
2018-11-06 11:18:42 -06:00
|
|
|
#
|
|
|
|
# ANSIBLE0010: Package installs should not use latest
|
|
|
|
# We often deploy latest pip packages
|
2019-06-06 15:25:15 +10:00
|
|
|
#
|
|
|
|
# 204: Lines < 160
|
|
|
|
# Things like keys, script lines, etc exceed this. We have good
|
|
|
|
# taste and only use long lines where appropriate.
|
|
|
|
#
|
|
|
|
# 206: {{var}} should have spaces {{ var }}
|
|
|
|
# This rule seems sane, but it appears there's no way to convince
|
|
|
|
# ansible-lint perfectly good things that are *not* ansible (like
|
|
|
|
# exim configs) in YAML shouldn't have to follow this rule. See
|
|
|
|
# https://github.com/ansible/ansible-lint/issues/534; might be able
|
|
|
|
# to turn on if fixed.
|
|
|
|
#
|
|
|
|
# 306: shells with pipes should use pipefail
|
|
|
|
# This requires running the shell as /bin/bash. There is a small
|
|
|
|
# possibility to hide errors, but we can rely on
|
|
|
|
# developers to decide when to explicitly check for failures.
|
2018-08-22 15:34:25 +10:00
|
|
|
bash -c "find roles playbooks -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \
|
2018-11-06 11:18:42 -06:00
|
|
|
ansible-lint -x ANSIBLE0004 -x ANSIBLE0006 -x ANSIBLE0007 -x ANSIBLE0010 \
|
2019-03-05 15:24:24 -08:00
|
|
|
-x ANSIBLE0011 -x ANSIBLE0012 -x ANSIBLE0013 -x ANSIBLE0015 \
|
2019-06-06 15:25:15 +10:00
|
|
|
-x 204 -x 206 -x 304 -x 306"
|
2015-12-22 10:15:21 +01:00
|
|
|
|
2012-09-26 13:39:31 -07:00
|
|
|
[testenv:venv]
|
|
|
|
commands = {posargs}
|
2013-09-19 07:57:23 -07:00
|
|
|
|
2014-08-27 14:10:16 -04:00
|
|
|
[testenv:docs]
|
2018-08-20 14:14:30 +10:00
|
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
|
|
commands = sphinx-build -W -E -b html doc/source doc/build/html
|
2014-08-27 14:10:16 -04:00
|
|
|
|
2018-08-22 09:46:07 -07:00
|
|
|
[testenv:testinfra]
|
2018-08-29 11:04:07 -07:00
|
|
|
commands = py.test --junit-xml junit.xml --connection=ansible --ansible-inventory=/etc/ansible/hosts/inventory.yaml -v testinfra {posargs}
|
2018-08-22 09:46:07 -07:00
|
|
|
|
2013-09-19 07:57:23 -07:00
|
|
|
[flake8]
|
|
|
|
show-source = True
|
2015-12-07 10:47:37 +01:00
|
|
|
exclude = .tox,.eggs
|
2013-09-19 07:57:23 -07:00
|
|
|
ignore = E125,H
|
2014-05-29 23:48:56 +02:00
|
|
|
select = H231
|