Skip to content

Commit

Permalink
Added new Travis CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei Antipov committed Apr 17, 2016
1 parent 8089efd commit b387a16
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
47 changes: 46 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ before_install:
- sudo ln -s ${PWD} /etc/ansible/roles/greendayonfire.mongodb

script:
# Test 1
- sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e mongodb_version=${MONGODB_VERSION}
# Idempotence test
- >
Expand All @@ -47,4 +48,48 @@ script:
# Delete all containers
- sudo docker kill mongo{1,2,3} && docker rm mongo{1,2,3}


# Test 2
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1
-e mongodb_version=${MONGODB_VERSION} -e mongodb_security_authorization='enabled'
# Idempotence test
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1
-e mongodb_version=${MONGODB_VERSION} -e mongodb_security_authorization='enabled'
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
# Delete all containers
- sudo docker kill mongo{1,2,3} && docker rm mongo{1,2,3}

# Test 3
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
# Idempotence test
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
# Delete all containers
- sudo docker kill mongo{1,2,3} && docker rm mongo{1,2,3}

# Test 4
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
-e mongodb_security_authorization='enabled'
# Idempotence test
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
-e mongodb_security_authorization='enabled'
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
1 change: 0 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ galaxy_info:
- name: Debian
versions:
- wheezy
- jessie
categories:
- database
- database:nosql

0 comments on commit b387a16

Please sign in to comment.