Skip to content

Commit

Permalink
Add tox for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
orachide committed Jun 3, 2019
1 parent 23528d6 commit df4adda
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
*.log

*.pytest_cache/

# Tox
.tox/
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ language: python
services:
- docker
before_install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y install docker-ce
- sudo apt-get -qq update
install:
- pip install -r ci-requirement.txt
- pip install tox-travis
script:
- molecule test -s default
- tox
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
4 changes: 2 additions & 2 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ driver:
lint:
name: yamllint
platforms:
- name: sb_centos6
- name: sb_centos6-$TOX_ENVNAME
image: centos:6
privileged: True
- name: sb_centos7
- name: sb_centos7-$TOX_ENVNAME
image: centos:7
privileged: True
command: '/sbin/init'
Expand Down
1 change: 0 additions & 1 deletion ci-requirement.txt → requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
ansible==2.4.5
molecule==2.19.0
docker<3.0.0
18 changes: 18 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[tox]
minversion = 3.4.0
envlist = py{27,36}-ansible{24,25,26,27}
skipsdist = true

[testenv]
passenv = *
deps =
-rrequirements.txt
ansible24: ansible>=2.4,<2.5
ansible25: ansible>=2.5,<2.6
ansible26: ansible>=2.6,<2.7
ansible27: ansible>=2.7,<2.8
commands =
molecule test -s default
setenv =
TOX_ENVNAME={envname}
MOLECULE_EPHEMERAL_DIRECTORY=/tmp/{envname}

0 comments on commit df4adda

Please sign in to comment.