forked from telus/ansible-fish
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
adding serverspec/travis tests
- Loading branch information
1 parent
ff095a5
commit 1f12888
Showing
9 changed files
with
60 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
driver: | ||
# using docker to test | ||
name: docker | ||
privileged: true | ||
|
||
provisioner: | ||
# use an ansible playbook to provision our server | ||
name: ansible_playbook | ||
# name of the host | ||
hosts: test-kitchen | ||
# list ansible galaxy requirements from meta/main.yml | ||
requirements_path: requirements.yml | ||
|
||
|
||
platforms: | ||
- name: ubuntu-14.04 | ||
|
||
suites: | ||
# suites found at /test/integration/$test-name | ||
- name: default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,15 @@ | ||
--- | ||
language: python | ||
python: "2.7" | ||
|
||
env: | ||
- SITE=test-install.yml | ||
|
||
before_install: | ||
- sudo apt-get update -qq | ||
- sudo apt-get install -y curl | ||
sudo: required | ||
# docker is required to run tests | ||
services: docker | ||
|
||
install: | ||
# Install Ansible. | ||
- pip install ansible | ||
|
||
# Add ansible.cfg to pick up roles path. | ||
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg" | ||
|
||
# Install dependencies | ||
- ansible-galaxy install telusdigital.apt-repository | ||
- bundle install | ||
|
||
script: | ||
# Check the role/playbook's syntax. | ||
- "ansible-playbook -i tests/inventory tests/$SITE --syntax-check" | ||
|
||
# Run the role/playbook with ansible-playbook. | ||
- "ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo" | ||
|
||
# Run the role/playbook again, checking to make sure it's idempotent. | ||
- > | ||
fish -v | ||
|& grep -q 'fish, version' | ||
&& (echo 'Fish installed') | ||
|| (echo 'Fish not installed') | ||
# Just for good measure | ||
- fish -v | ||
# run kitchen tests (destroy, create, converge, setup, verify and destroy) | ||
- bundle exec kitchen test | ||
|
||
notifications: | ||
slack: | ||
secure: K+Qf40Tui8xo71/0m6v6B+LYl8eTfiBYUu5u8+amGNIERtfbhtvzuYhIYBZGaa1cWJeQc8woAbdDvh4vh/Lj22TR3PsNG3UGgb75lSrYpJ9XJOiuBeyP35nXF1lhCOzFVhwziMdQWy1nfvl16dTIb73G/tFCZMotu9Jl2bZDl2G88bkFZlLtuX3rEXbmyqNIYiy3Z3f+3N5hujenBOABGblnui63vjROy4slM991UbdX++c/ogg+czzopl7C3zAqCPj4fqp7Wu5S0jwn15IFy1dgnJzVqlmvrpwxkzl7K3K9lvRnG/dk0louNlaUiIinzZ3npUqOPkY66e7SoiFhgjeXRHK/33it0UriifPcw1+f9ZvbzyULlYmvvIRAOyQyKikLC/SP4Q4X/Y55KdKmE8wB54q8bRKwSjlTtkDCLBmYiAApV58uyL1hyqHee7wQkYzLHZ1IkE35/mrBxDCoy8QrmCQBmdJv2H+dQVc8VhTWVSOMo+FLHr0d7jp/Kmngvo/OJYbAwPPQbl7vjOSHlLkbf9tqFRGsMzZsiqeTrRxWe4FVB599gA7h7KJ3CAzSsgtpugd+m9mk6/GBoYooouBDkxx4qD6LSMLjhYerYYCgHQCX5s1p9+A1cXtZ3T6DSUncQ7Hx0Q+beLWS8MOmFdqBNVt5K2CND5fdwiOBLqo= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'test-kitchen' | ||
gem 'serverspec' | ||
gem 'kitchen-ansible' | ||
gem 'kitchen-docker' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
- src: telusdigital.apt-repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
# host to test against | ||
- hosts: test-kitchen | ||
remote_user: root | ||
|
||
roles: | ||
# name of role to test | ||
- role: ansible-fish |
9 changes: 9 additions & 0 deletions
9
test/integration/default/serverspec/localhost/default_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require 'spec_helper' | ||
|
||
describe 'ansible-fish::default' do | ||
|
||
describe package('fish') do | ||
it { should be_installed.by('apt') } | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require 'serverspec' | ||
|
||
# :backend can be either :exec or :ssh | ||
# since we are running local we use :exec | ||
set :backend, :exec |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.