diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 13eb0f0645a7773ac752210f1bde980e2b30c859..bd9a4d714377ea51d2cd14419ae059cc9307b5d5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ - repo: https://github.com/pre-commit/pre-commit-hooks - sha: 7539d8bd1a00a3c1bfd34cdb606d3a6372e83469 + sha: v0.7.1 hooks: - id: check-added-large-files - id: check-json @@ -9,22 +9,15 @@ - id: flake8 - id: check-symlinks - repo: https://github.com/adarnimrod/ansible-pre-commit.git - sha: v0.5.0 + sha: v0.6.0 hooks: - id: ansible-syntax-check - always_run: true - files: tests/playbook.yml - args: - - tests/playbook.yml - repo: https://github.com/willthames/ansible-lint - sha: 959ab0f525e9abb19cf75f34381015cf33695f61 + sha: v3.4.12 hooks: - id: ansible-lint - always_run: true files: tests/playbook.yml - args: - - tests/playbook.yml - repo: https://github.com/adarnimrod/python-pre-commit.git - sha: v0.1.0 + sha: v0.2.0 hooks: - id: piprot diff --git a/.travis.yml b/.travis.yml index 211dd1bca2db18e80ff9a4c3503735ca67efda9b..5849002ab10132b0c1b76c7819bf902b823e33e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,19 +10,18 @@ env: matrix: - TOXENV=pre-commit - TOXENV=openbsd60 - - &openbsd59 TOXENV=openbsd59 - TOXENV=xenial - TOXENV=trusty - TOXENV=precise - &stretch TOXENV=stretch - - TOXENV=jessie + - &jessie TOXENV=jessie - TOXENV=wheezy matrix: fast_finish: True allow_failures: - python: "3.5" - - env: *openbsd59 - env: *stretch + - env: *jessie cache: - pip - directories: @@ -33,7 +32,7 @@ install: - sudo apt-get install -y linux-headers-$(uname -r) virtualbox - wget https://releases.hashicorp.com/vagrant/1.9.1/vagrant_1.9.1_x86_64.deb - sudo dpkg -i vagrant_1.9.1_x86_64.deb - - pip install tox | cat + - pip install tox-travis | cat script: - travis_wait 45 tox diff --git a/README.rst b/README.rst index ddc2091af353d8adfa06408832c0a4a1bbde68d8..5cfb77dfa5c1df6c8caa2bb5404b89582540ed9a 100644 --- a/README.rst +++ b/README.rst @@ -29,21 +29,9 @@ See :code:`tests/playbook.yml`. Testing ------- -Testing requires Python 2.7, Vagrant and Virtualbox. Install the Python -dependencies, dependent roles and roles required for testing: - -.. code:: shell - - pip install -r tests/requirements.txt - ansible-galaxy install git+file://$(pwd),$(git rev-parse --abbrev-ref HEAD) -p .molecule/roles - molecule dependency - -To run the full test suite: - -.. code:: shell - - pre-commit run --all-files - molecule test --platform all +Testing requires Python 2.7, Tox, Vagrant and Virtualbox. To test simply run +:code:`tox`. `Pre-commit <http://pre-commit.com/>`_ is also setup for this +project. License ------- diff --git a/molecule.yml b/molecule.yml index 1984ae752775234591b975d7314f6529360288bb..bd82a64ded6ea2f1b5cc22c4df68b7391329afe8 100644 --- a/molecule.yml +++ b/molecule.yml @@ -22,8 +22,6 @@ vagrant: platforms: - name: openbsd60 box: fnichol/openbsd-6.0-i386 - - name: openbsd59 - box: fnichol/openbsd-5.9-i386 - name: xenial box: ubuntu/xenial32 - name: trusty diff --git a/tests/requirements.txt b/tests/requirements.txt index 4048613cd74709b38431e3ad1d4010fcef266f4a..c0ffb8cc7e76a09533f8b216ed2374b29e94fdff 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,10 +1,8 @@ -ansible==2.2.1.0 -testinfra==1.5.3 -molecule==1.20.0 -ansible-lint==3.4.10 -pre-commit==0.12.2 -piprot==0.9.7 +ansible==2.3.0.0 +testinfra==1.5.5 +molecule==1.23.2 +ansible-lint==3.4.12 python-vagrant==0.5.14 netaddr==0.7.19 passlib==1.7.1 -bcrypt==3.1.2 +bcrypt==3.1.3 diff --git a/tox.ini b/tox.ini index 9f02b87ddc27c541707de71496512c2dbd1bc799..cd0873a5e0615e8dc74819f9051557d358d1d392 100644 --- a/tox.ini +++ b/tox.ini @@ -1,22 +1,27 @@ [tox] skip_install = True skipsdist = True -envlist = openbsd60,openbsd59,xenial,trusty,precise,stretch,jessie,wheezy +envlist = openbsd60,xenial,trusty,precise,stretch,jessie,wheezy -[testenv:pre-commit] +[testenv] +envdir = {toxinidir}/.tox deps = -rtests/requirements.txt +passenv = HOME VBOX* ANSIBLE_* whitelist_externals = sh commands = sh -c "ansible-galaxy install git+file://$(pwd),$(git rev-parse --abbrev-ref HEAD) -p .molecule/roles" - molecule dependency - pre-commit run --all-files + molecule test --platform {envname} -[testenv] -deps = -rtests/requirements.txt -passenv = HOME +[testenv:pre-commit] +envdir = {toxinidir}/.tox +deps = + -rtests/requirements.txt + pre-commit +passenv = HOME VBOX* ANSIBLE_* whitelist_externals = sh commands = sh -c "ansible-galaxy install git+file://$(pwd),$(git rev-parse --abbrev-ref HEAD) -p .molecule/roles" - molecule test --platform {envname} + molecule dependency + pre-commit run --all-files