Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
*~
*#
.#*
\#*#
.*.sw[a-z]
*.un~
pkg/

# Berkshelf
.vagrant
/cookbooks
Berksfile.lock

# Bundler
Gemfile.lock
bin/*
.bundle/*

.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[chef-sentry-handler-test::default]
attributes:
8 changes: 8 additions & 0 deletions Berksfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source 'https://supermarket.getchef.com'

metadata

group :test do
cookbook 'chef-sentry-handler-test',
path: './test/cookbook/chef-sentry-handler-test'
end
10 changes: 10 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
source 'https://rubygems.org'

group :development do
gem 'berkshelf'
end

group :integration do
gem 'test-kitchen'
gem 'kitchen-vagrant'
end
12 changes: 12 additions & 0 deletions Thorfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# encoding: utf-8

require 'bundler'
require 'bundler/setup'
require 'berkshelf/thor'

begin
require 'kitchen/thor_tasks'
Kitchen::ThorTasks.new
rescue LoadError
puts ">>>>> Kitchen gem not loaded, omitting tasks" unless ENV['CI']
end
94 changes: 94 additions & 0 deletions chefignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Put files/directories that should be ignored in this file when uploading
# or sharing to the community site.
# Lines that start with '# ' are comments.

# OS generated files #
######################
.DS_Store
Icon?
nohup.out
ehthumbs.db
Thumbs.db

# SASS #
########
.sass-cache

# EDITORS #
###########
\#*
.#*
*~
*.sw[a-z]
*.bak
REVISION
TAGS*
tmtags
*_flymake.*
*_flymake
*.tmproj
.project
.settings
mkmf.log

## COMPILED ##
##############
a.out
*.o
*.pyc
*.so
*.com
*.class
*.dll
*.exe
*/rdoc/

# Testing #
###########
.watchr
.rspec
spec/*
spec/fixtures/*
test/*
features/*
Guardfile
Procfile

# SCM #
#######
.git
*/.git
.gitignore
.gitmodules
.gitconfig
.gitattributes
.svn
*/.bzr/*
*/.hg/*
*/.svn/*

# Berkshelf #
#############
cookbooks/*
tmp

# Cookbooks #
#############
CONTRIBUTING
CHANGELOG*

# Strainer #
############
Colanderfile
Strainerfile
.colander
.strainer

# Vagrant #
###########
.vagrant
Vagrantfile

# Travis #
##########
.travis.yml
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set['sentry']['dsn'] = 'https://user:password@app.getsentry.com/'
9 changes: 9 additions & 0 deletions test/cookbook/chef-sentry-handler-test/metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name 'chef-sentry-handler-test'
maintainer 'EverTrue'
maintainer_email 'devops@evertrue.com'
license 'Apache 2.0'
description 'Test cookbook for the chef-sentry-handler cookbook'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.0.0'

depends 'chef-sentry-handler'
1 change: 1 addition & 0 deletions test/cookbook/chef-sentry-handler-test/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include_recipe 'chef-sentry-handler::default'
27 changes: 27 additions & 0 deletions test/integration/default/serverspec/default_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
require 'spec_helper'

describe 'chef-sentry-handler::default' do
describe file('/tmp/kitchen/handlers') do
it { should be_directory }
it { should be_mode 755 }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
end

describe file('/tmp/kitchen/handlers/sentry.rb') do
it { should be_file }
it { should be_mode 644 }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
end

describe file('/opt/chef/embedded/lib/ruby/gems/' \
'1.9.1/gems/uuidtools-2.1.5') do
it { should be_directory }
end

describe file('/opt/chef/embedded/lib/ruby/gems/' \
'1.9.1/gems/sentry-raven-0.9.4') do
it { should be_directory }
end
end
11 changes: 11 additions & 0 deletions test/integration/default/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require 'serverspec'
require 'pathname'

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

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