Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #25 from cotap/kitchen-ci
Browse files Browse the repository at this point in the history
Kitchen ci
  • Loading branch information
mheffner committed Jul 30, 2014
2 parents 8041cac + 63cd262 commit 88bd2f2
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ Berksfile.lock
.*.sw[a-z]
*.un~
/cookbooks
.kitchen/
.kitchen.local.yml
15 changes: 15 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
driver:
name: vagrant

provisioner:
name: chef_solo

platforms:
- name: ubuntu-12.04

suites:
- name: default
run_list:
- recipe[statsd::default]
attributes:
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ source 'https://rubygems.org'
gem 'berkshelf', '~> 3.0'
gem 'chef'
gem 'chefspec'
gem 'test-kitchen'
gem 'kitchen-vagrant'
13 changes: 13 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ GEM
hitimes (1.2.2)
ipaddress (0.8.0)
json (1.8.1)
kitchen-vagrant (0.15.0)
test-kitchen (~> 1.0)
method_source (0.8.2)
mime-types (1.25.1)
minitar (0.5.4)
Expand All @@ -88,6 +90,8 @@ GEM
mixlib-shellout (1.4.0)
multipart-post (2.0.0)
net-http-persistent (2.9.4)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (2.9.1)
net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5)
Expand Down Expand Up @@ -146,6 +150,7 @@ GEM
rspec-mocks (3.0.3)
rspec-support (~> 3.0.0)
rspec-support (3.0.3)
safe_yaml (1.0.3)
sawyer (0.5.4)
addressable (~> 2.3.5)
faraday (~> 0.8, < 0.10)
Expand All @@ -155,6 +160,12 @@ GEM
dep_selector (~> 1.0)
semverse (~> 1.1)
systemu (2.5.2)
test-kitchen (1.2.1)
mixlib-shellout (~> 1.2)
net-scp (~> 1.1)
net-ssh (~> 2.7)
safe_yaml (~> 1.0)
thor (~> 0.18)
thor (0.19.1)
timers (4.0.0)
hitimes
Expand All @@ -170,3 +181,5 @@ DEPENDENCIES
berkshelf (~> 3.0)
chef
chefspec
kitchen-vagrant
test-kitchen
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,16 @@ For example, to set your email and token for the
'token' => '1234567890ABCDEF'
}
}
```
```

# Test

To run unit tests using rspec you can run:
```bash
$ bundle exec rspec
```

To run integration tests using kitchen-ci you can run:
```bash
$ bundle exec kitchen test
```
28 changes: 28 additions & 0 deletions test/integration/default/serverspec/default_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require 'serverspec'

include Serverspec::Helper::Exec
include Serverspec::Helper::DetectOS

RSpec.configure do |c|
c.before :all do
c.path = '/sbin:/usr/sbin'
end
end

describe 'statsd service' do
it 'should be configured for upstart' do
expect(file('/etc/init/statsd.conf')).to be_file
end

it 'should be enabled' do
expect(service('statsd')).to be_enabled
end

it 'should be running' do
expect(service('statsd')).to be_running
end

it 'should be listening' do
expect(port('8125')).to be_listening.with('udp')
end
end

0 comments on commit 88bd2f2

Please sign in to comment.