diff --git a/.gitignore b/.gitignore index acf553a..4438f9c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ tests/__pycache__/ *.pyc *.retry +.tox diff --git a/.travis.yml b/.travis.yml index affbbd0..253c237 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ --- - language: python python: "2.7" +cache: pip # Use the new container infrastructure sudo: required @@ -10,13 +10,19 @@ sudo: required services: - docker -# Install molecule -install: - - pip install -r test-requirements.txt +env: + matrix: + - ANSIBLE=2.3 + - ANSIBLE=2.4 + - ANSIBLE=2.5 -# Execute the tests using the molecule docker driver +# Install tox +install: + - pip install tox-travis + +# Execute tests script: - - molecule test --all + - tox notifications: webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/test-requirements.txt b/test-requirements.txt index 25117e9..b1a863e 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,4 @@ molecule>=2.15.0 -docker-py>=1.10.0 -PyYAML==3.12 +docker ansible-lint>=3.4.0 +testinfra>=1.7.0 diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..d32a1ca --- /dev/null +++ b/tox.ini @@ -0,0 +1,20 @@ +[tox] +minversion = 1.8 +envlist = py{27}-ansible{23,24,25} +skipsdist = true + +[travis:env] +ANSIBLE= + 2.3: ansible23 + 2.4: ansible24 + 2.5: ansible25 + +[testenv] +passenv = * +deps = + -rtest-requirements.txt + ansible23: ansible<2.4 + ansible24: ansible<2.5 + ansible25: ansible<2.6 +commands = + {posargs:molecule test --all --destroy always}