Skip to content
Snippets Groups Projects
Commit e5153293 authored by nimrod's avatar nimrod
Browse files

- Cleaner Tox usage.

parent 2ecaa5ae
No related branches found
No related tags found
No related merge requests found
...@@ -9,14 +9,14 @@ env: ...@@ -9,14 +9,14 @@ env:
- VBOX_MEMORY=2048 - VBOX_MEMORY=2048
matrix: matrix:
- TOXENV=pre-commit - TOXENV=pre-commit
- TOXENV=openbsd60 - tox_switches="--platform openbsd60"
- &openbsd59 TOXENV=openbsd59 - &openbsd59 tox_switches="--platform openbsd59"
- TOXENV=xenial - tox_switches="--platform xenial"
- TOXENV=trusty - tox_switches="--platform trusty"
- TOXENV=precise - tox_switches="--platform precise"
- &stretch TOXENV=stretch - &stretch tox_switches="--platform stretch"
- TOXENV=jessie - tox_switches="--platform jessie"
- TOXENV=wheezy - tox_switches="--platform wheezy"
matrix: matrix:
fast_finish: True fast_finish: True
allow_failures: allow_failures:
...@@ -27,6 +27,7 @@ cache: ...@@ -27,6 +27,7 @@ cache:
- pip - pip
- directories: - directories:
- $HOME/.pre-commit - $HOME/.pre-commit
- .tox
install: install:
- sudo apt-get update - sudo apt-get update
...@@ -36,7 +37,7 @@ install: ...@@ -36,7 +37,7 @@ install:
- pip install tox | cat - pip install tox | cat
script: script:
- travis_wait 45 tox - travis_wait 45 tox -- $tox_switches
notifications: notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/ webhooks: https://galaxy.ansible.com/api/v1/notifications/
......
...@@ -31,21 +31,9 @@ See :code:`tests/playbook.yml`. ...@@ -31,21 +31,9 @@ See :code:`tests/playbook.yml`.
Testing Testing
------- -------
Testing requires Python 2.7, Vagrant and Virtualbox. Install the Python Testing requires Python 2.7, Tox, Vagrant and Virtualbox. To test simply run
dependencies, dependent roles and roles required for testing: :code:`tox`. `Pre-commit <http://pre-commit.com/>`_ is also setup for this
project.
.. 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
License License
------- -------
......
[tox] [tox]
skip_install = True skip_install = True
skipsdist = True skipsdist = True
envlist = openbsd60,openbsd59,xenial,trusty,precise,stretch,jessie,wheezy envlist = molecule
[testenv:pre-commit] [testenv:pre-commit]
envdir = {toxinidir}/.tox
deps = -rtests/requirements.txt deps = -rtests/requirements.txt
passenv = HOME VBOX* ANSIBLE_*
whitelist_externals = whitelist_externals =
sh sh
commands = commands =
...@@ -12,11 +14,12 @@ commands = ...@@ -12,11 +14,12 @@ commands =
molecule dependency molecule dependency
pre-commit run --all-files pre-commit run --all-files
[testenv] [testenv:molecule]
envdir = {toxinidir}/.tox
deps = -rtests/requirements.txt deps = -rtests/requirements.txt
passenv = HOME passenv = HOME VBOX* ANSIBLE_*
whitelist_externals = whitelist_externals =
sh sh
commands = commands =
sh -c "ansible-galaxy install git+file://$(pwd),$(git rev-parse --abbrev-ref HEAD) -p .molecule/roles" sh -c "ansible-galaxy install git+file://$(pwd),$(git rev-parse --abbrev-ref HEAD) -p .molecule/roles"
molecule test --platform {envname} molecule test {posargs}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment