diff --git a/.gitignore b/.gitignore index 9de1080..cf63060 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ config.yaml *.vdi .tox doc/build +*egg* diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..380fdab --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,10 @@ +PyYAML +Pygments +ansible +bashate +doc8 +docutils +flake8 +oslosphinx +pbr>=0.6,!=0.7,<1.0 +sphinx>=1.1.2,<1.2 diff --git a/tests/hosts.test b/tests/hosts.test new file mode 100644 index 0000000..75474c8 --- /dev/null +++ b/tests/hosts.test @@ -0,0 +1,2 @@ +[local] +127.0.0.1 diff --git a/tox.ini b/tox.ini index 968fb6a..40fa212 100644 --- a/tox.ini +++ b/tox.ini @@ -5,27 +5,19 @@ skipsdist = True [testenv] usedevelop = False +deps = -r{toxinidir}/test-requirements.txt install_command = pip install {opts} {packages} +[testenv:venv] +commands = {posargs} + [testenv:docs] -deps = - Pygments - docutils - sphinx>=1.1.2,<1.2 - pbr>=0.6,!=0.7,<1.0 - oslosphinx commands = python setup.py build_sphinx [testenv:lint] whitelist_externals = bash -deps = - ansible - bashate - doc8 - flake8 - PyYAML commands = - ansible-playbook --syntax-check playbook.yaml + ansible-playbook --syntax-check -i tests/hosts.test playbook.yaml bash -c "find {toxinidir} \ \( -wholename \*/files/\*.sh -or \ -wholename \*/scripts/\*.sh \) -print0 | \ @@ -36,4 +28,4 @@ commands = [flake8] show-source = True -exclude=.venv,.git,.tox +exclude=.venv,.git,.tox,*egg*