Add tox.ini and ansible-lint cleanup
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
f367b9a838
commit
7284ca30ac
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.tox/
|
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@ -0,0 +1 @@
|
||||
ansible
|
2
test-requirements.txt
Normal file
2
test-requirements.txt
Normal file
@ -0,0 +1,2 @@
|
||||
ansible-lint
|
||||
hacking<0.11,>=0.10
|
33
tox.ini
Normal file
33
tox.ini
Normal 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}
|
Loading…
Reference in New Issue
Block a user