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

Merge branch 'feature/tox_env'

parents 6fb81b36 f9fba47c
No related branches found
No related tags found
No related merge requests found
...@@ -9,3 +9,4 @@ __pycache__ ...@@ -9,3 +9,4 @@ __pycache__
.vagrant/ .vagrant/
*.log *.log
*.retry *.retry
.tox
...@@ -8,14 +8,15 @@ env: ...@@ -8,14 +8,15 @@ env:
global: global:
- VBOX_MEMORY=2048 - VBOX_MEMORY=2048
matrix: matrix:
- platform: openbsd60 - TOXENV=pre-commit
- &openbsd59 platform=openbsd59 - TOXENV=openbsd60
- platform: xenial - &openbsd59 TOXENV=openbsd59
- platform: trusty - TOXENV=xenial
- platform: precise - TOXENV=trusty
- &stretch platform=stretch - TOXENV=precise
- &jessie platform=jessie - &stretch TOXENV=stretch
- platform: wheezy - &jessie TOXENV=jessie
- TOXENV=wheezy
matrix: matrix:
fast_finish: True fast_finish: True
allow_failures: allow_failures:
...@@ -33,13 +34,10 @@ install: ...@@ -33,13 +34,10 @@ install:
- sudo apt-get install -y linux-headers-$(uname -r) virtualbox - 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 - 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 - sudo dpkg -i vagrant_1.9.1_x86_64.deb
- pip install -r tests/requirements.txt | cat - pip install tox-travis | cat
- ansible-galaxy install git+file://$(pwd),$(git rev-parse --abbrev-ref HEAD) -p .molecule/roles
- molecule dependency
script: script:
- pre-commit run --all-files - travis_wait 45 tox
- travis_wait 45 molecule test --platform $platform
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
------- -------
......
...@@ -5,6 +5,10 @@ ansible: ...@@ -5,6 +5,10 @@ ansible:
diff: True diff: True
config_file: ../ansible.cfg config_file: ../ansible.cfg
molecule:
ignore_paths:
- .tox
dependency: dependency:
name: galaxy name: galaxy
requirements_file: tests/requirements.yml requirements_file: tests/requirements.yml
......
...@@ -2,7 +2,6 @@ ansible==2.3.0.0 ...@@ -2,7 +2,6 @@ ansible==2.3.0.0
testinfra==1.5.5 testinfra==1.5.5
molecule==1.23.2 molecule==1.23.2
ansible-lint==3.4.12 ansible-lint==3.4.12
pre-commit==0.13.6
python-vagrant==0.5.14 python-vagrant==0.5.14
netaddr==0.7.19 netaddr==0.7.19
passlib==1.7.1 passlib==1.7.1
......
tox.ini 0 → 100644
[tox]
skip_install = True
skipsdist = True
envlist = openbsd60,openbsd59,xenial,trusty,precise,stretch,jessie,wheezy
[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 test --platform {envname}
[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 dependency
pre-commit run --all-files
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