Add tox.ini and ansible-lint cleanup

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2015-11-20 17:00:24 -05:00
parent f367b9a838
commit 7284ca30ac
6 changed files with 43 additions and 6 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.tox/

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
ansible

2
test-requirements.txt Normal file
View File

@ -0,0 +1,2 @@
ansible-lint
hacking<0.11,>=0.10

33
tox.ini Normal file
View File

@ -0,0 +1,33 @@
[tox]
minversion = 1.6
envlist = ansible-lint,pep8
skipsdist = True
[testenv]
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:ansible-lint]
setenv =
ANSIBLE_CONFIG = tests/ansible.cfg
whitelist_externals = bash
commands =
bash -c "find . -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \
ansible-lint"
bash -c "find tests -type f -regex '.*.y[a]?ml' -print | xargs -t -n1 \
ansible-playbook --syntax-check -i tests/inventory \
-e rolename=$(basename $(pwd)) > /dev/null"
[testenv:ansible-functional]
commands =
ansible-playbook -i tests/inventory tests/test.yaml
passenv = HOME
setenv =
ANSIBLE_CONFIG = {toxinidir}/tests/ansible.cfg
PYTHONUNBUFFERED = 1
[testenv:pep8]
commands = flake8
[testenv:venv]
commands = {posargs}