-
-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating test harness. Fixing up rubocops
- Loading branch information
Sean OMeara
committed
Feb 17, 2014
1 parent
567e220
commit 6b3a5be
Showing
13 changed files
with
676 additions
and
203 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 |
---|---|---|
@@ -1,6 +1,15 @@ | ||
.vagrant | ||
Berksfile.lock | ||
Gemfile.lock | ||
*~ | ||
*# | ||
.#* | ||
\#*# | ||
.*.sw[a-z] | ||
*.un~ | ||
.bundle | ||
.cache | ||
.kitchen | ||
bin | ||
.kitchen/ | ||
.kitchen.local.yml | ||
.coverage |
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,107 @@ | ||
--- | ||
driver_config: | ||
digitalocean_client_id: <%= ENV['DIGITAL_OCEAN_CLIENT_ID'] %> | ||
digitalocean_api_key: <%= ENV['DIGITAL_OCEAN_API_KEY'] %> | ||
aws_access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %> | ||
aws_secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %> | ||
aws_ssh_key_id: <%= ENV['AWS_KEYPAIR_NAME'] %> | ||
|
||
provisioner: | ||
name: chef_zero | ||
require_chef_omnibus: latest | ||
|
||
platforms: | ||
# - name: centos-5.8 | ||
# driver_plugin: digitalocean | ||
# driver_config: | ||
# image_id: 1601 | ||
# flavor_id: 63 | ||
# region_id: 4 | ||
# ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %> | ||
# ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %> | ||
|
||
- name: centos-6.4 | ||
driver_plugin: digitalocean | ||
driver_config: | ||
image_id: 562354 | ||
flavor_id: 63 | ||
region_id: 4 | ||
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %> | ||
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %> | ||
|
||
- name: amazon-2013.09 | ||
driver_plugin: ec2 | ||
driver_config: | ||
image_id: ami-3be4bc52 | ||
username: ec2-user | ||
ssh_key: <%= ENV['EC2_SSH_KEY_PATH'] %> | ||
|
||
# - name: fedora-19 | ||
# driver_plugin: digitalocean | ||
# driver_config: | ||
# image_id: 696598 | ||
# flavor_id: 63 | ||
# region_id: 4 | ||
# ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %> | ||
# ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %> | ||
|
||
- name: debian-70 | ||
driver_plugin: digitalocean | ||
driver_config: | ||
image_id: 308287 | ||
flavor_id: 63 | ||
region_id: 4 | ||
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %> | ||
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %> | ||
run_list: | ||
- recipe[apt] | ||
|
||
- name: ubuntu-1004 | ||
driver_plugin: digitalocean | ||
driver_config: | ||
image_id: 14097 | ||
flavor_id: 63 | ||
region_id: 4 | ||
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %> | ||
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %> | ||
run_list: | ||
- recipe[apt] | ||
|
||
- name: ubuntu-1204 | ||
driver_plugin: digitalocean | ||
driver_config: | ||
image_id: 1505447 | ||
flavor_id: 63 | ||
region_id: 4 | ||
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %> | ||
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %> | ||
run_list: | ||
- recipe[apt] | ||
|
||
- name: ubuntu-1304 | ||
driver_plugin: digitalocean | ||
driver_config: | ||
image_id: 350076 | ||
flavor_id: 63 | ||
region_id: 4 | ||
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %> | ||
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %> | ||
run_list: | ||
- recipe[apt] | ||
|
||
- name: ubuntu-1310 | ||
driver_plugin: digitalocean | ||
driver_config: | ||
image_id: 1505699 | ||
flavor_id: 63 | ||
region_id: 4 | ||
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %> | ||
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %> | ||
run_list: | ||
- recipe[apt] | ||
|
||
suites: | ||
- name: default | ||
run_list: | ||
- recipe[tomcat::default] | ||
attributes: {} |
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,28 @@ | ||
AllCops: | ||
Excludes: | ||
- vendor/** | ||
|
||
ClassLength: | ||
Enabled: false | ||
Documentation: | ||
Enabled: false | ||
Encoding: | ||
Enabled: false | ||
LineLength: | ||
Enabled: false | ||
MethodLength: | ||
Enabled: false | ||
TrailingComma: | ||
EnforcedStyleForMultiline: comma | ||
|
||
HashSyntax: | ||
EnforcedStyle: hash_rockets | ||
|
||
AlignParameters: | ||
Enabled: false | ||
|
||
CyclomaticComplexity: | ||
Enabled: false | ||
|
||
BlockAlignment: | ||
Enabled: false |
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,37 @@ | ||
source 'https://rubygems.org' | ||
|
||
group :lint do | ||
gem 'foodcritic', '~> 3.0' | ||
gem 'rubocop', '~> 0.18' | ||
gem 'rainbow', '< 2.0' | ||
end | ||
|
||
group :unit do | ||
gem 'berkshelf', '~> 3.0.0.beta6' | ||
gem 'chefspec', '~> 3.1' | ||
end | ||
|
||
group :kitchen_common do | ||
gem 'test-kitchen', '~> 1.2' | ||
end | ||
|
||
group :kitchen_vagrant do | ||
gem 'kitchen-vagrant', '~> 0.11' | ||
end | ||
|
||
group :kitchen_cloud do | ||
gem 'kitchen-digitalocean' | ||
gem 'kitchen-ec2' | ||
end | ||
|
||
group :development do | ||
gem 'ruby_gntp' | ||
gem 'growl' | ||
gem 'rb-fsevent' | ||
gem 'guard', '~> 2.4' | ||
gem 'guard-kitchen' | ||
gem 'guard-foodcritic' | ||
gem 'guard-rspec' | ||
gem 'guard-rubocop' | ||
gem 'rake' | ||
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,35 @@ | ||
# A sample Guardfile | ||
# More info at https://github.com/guard/guard#readme | ||
|
||
# guard 'kitchen' do | ||
# watch(%r{test/.+}) | ||
# watch(%r{^recipes/(.+)\.rb$}) | ||
# watch(%r{^attributes/(.+)\.rb$}) | ||
# watch(%r{^files/(.+)}) | ||
# watch(%r{^templates/(.+)}) | ||
# watch(%r{^providers/(.+)\.rb}) | ||
# watch(%r{^resources/(.+)\.rb}) | ||
# end | ||
|
||
guard 'foodcritic', cookbook_paths: '.', all_on_start: false do | ||
watch(%r{attributes/.+\.rb$}) | ||
watch(%r{providers/.+\.rb$}) | ||
watch(%r{recipes/.+\.rb$}) | ||
watch(%r{resources/.+\.rb$}) | ||
watch('metadata.rb') | ||
end | ||
|
||
guard 'rubocop', all_on_start: false do | ||
watch(%r{attributes/.+\.rb$}) | ||
watch(%r{providers/.+\.rb$}) | ||
watch(%r{recipes/.+\.rb$}) | ||
watch(%r{resources/.+\.rb$}) | ||
watch('metadata.rb') | ||
end | ||
|
||
guard :rspec, cmd: 'bundle exec rspec', all_on_start: false, notification: false do | ||
watch(%r{^libraries/(.+)\.rb$}) | ||
watch(%r{^spec/(.+)_spec\.rb$}) | ||
watch(%r{^(recipes)/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | ||
watch('spec/spec_helper.rb') { 'spec' } | ||
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,62 @@ | ||
require 'rspec/core/rake_task' | ||
require 'rubocop/rake_task' | ||
require 'foodcritic' | ||
require 'kitchen' | ||
|
||
# Style tests. Rubocop and Foodcritic | ||
namespace :style do | ||
desc 'Run Ruby style checks' | ||
Rubocop::RakeTask.new(:ruby) | ||
|
||
desc 'Run Chef style checks' | ||
FoodCritic::Rake::LintTask.new(:chef) do |t| | ||
t.options = { | ||
fail_tags: ['any'], | ||
tags: [ | ||
'~FC005', | ||
'~FC023', | ||
] | ||
} | ||
end | ||
end | ||
|
||
desc 'Run all style checks' | ||
task style: ['style:chef', 'style:ruby'] | ||
|
||
# Rspec and ChefSpec | ||
desc "Run ChefSpec examples" | ||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
# Integration tests. Kitchen.ci | ||
namespace :integration do | ||
desc 'Run Test Kitchen with Vagrant' | ||
task :vagrant do | ||
Kitchen.logger = Kitchen.default_file_logger | ||
Kitchen::Config.new.instances.each do |instance| | ||
instance.test(:always) | ||
end | ||
end | ||
|
||
desc 'Run Test Kitchen with cloud plugins' | ||
task :cloud do | ||
run_kitchen = true | ||
if ENV['TRAVIS'] == 'true' && ENV['TRAVIS_PULL_REQUEST'] != 'false' | ||
run_kitchen = false | ||
end | ||
|
||
if run_kitchen | ||
Kitchen.logger = Kitchen.default_file_logger | ||
@loader = Kitchen::Loader::YAML.new(project_config: './.kitchen.cloud.yml') | ||
config = Kitchen::Config.new( loader: @loader) | ||
config.instances.each do |instance| | ||
instance.test(:always) | ||
end | ||
end | ||
end | ||
end | ||
|
||
desc 'Run all tests on Travis' | ||
task travis: ['style', 'spec', 'integration:cloud'] | ||
|
||
# Default | ||
task default: ['style', 'spec', 'integration:vagrant'] |
Oops, something went wrong.