From 5cc182408d4cf79f7ab4f906b0c560cb4d414730 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Wed, 11 Nov 2015 21:40:47 -0500 Subject: [PATCH] Add tox -eansible-lint support Start using tox to setup ansible-lint since we are dealing with python modules. This is part of an effort to have all ansible modules use the same testing syntax. Change-Id: I2b38d165472606a12208ec198a9ac4dab967bc72 Signed-off-by: Paul Belanger --- .gitignore | 1 + requirements.txt | 1 + test-requirements.txt | 1 + tox.ini | 16 ++++++++++++++++ 4 files changed, 19 insertions(+) create mode 100644 .gitignore create mode 100644 requirements.txt create mode 100644 test-requirements.txt create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..33defe4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.tox/ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..90d4055 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +ansible diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..6dd128e --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +ansible-lint diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..380fb70 --- /dev/null +++ b/tox.ini @@ -0,0 +1,16 @@ +[tox] +minversion = 1.6 +envlist = ansible-lint +skipsdist = True + +[testenv] +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +[testenv:ansible-lint] +whitelist_externals = bash +commands = + bash -c "find . -type f -regex '.*.y[a]?ml' -execdir ansible-lint \{\} \;" + +[testenv:venv] +commands = {posargs}