Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
48 additions
and
38 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,8 +1,7 @@ | ||
language: ruby | ||
rvm: | ||
- 1.9.2 | ||
- 1.9.3 | ||
- 2.0.0 | ||
- 2.1.0 | ||
bundler_args: --without integration | ||
script: | ||
- bundle exec rake test | ||
- bundle exec rake travis |
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,3 +1,3 @@ | ||
site :opscode | ||
source 'https://supermarket.getchef.com' | ||
|
||
metadata |
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,18 +1,15 @@ | ||
source 'https://rubygems.org' | ||
|
||
group :test, :development, :integration do | ||
gem 'rake' | ||
gem 'chef', '>= 10.12.0' | ||
end | ||
gem 'rake' | ||
gem 'berkshelf', '~> 3.1.4' | ||
gem 'stove' | ||
|
||
group :test, :integration do | ||
gem 'chefspec', '~> 3.0' | ||
gem 'foodcritic', '~> 3.0' | ||
gem 'rubocop', '~> 0.16' | ||
group :test do | ||
gem 'foodcritic', '~> 4.0.0' | ||
gem 'rubocop', '~> 0.24.1' | ||
end | ||
|
||
group :integration do | ||
gem 'berkshelf', '~> 2.0' | ||
gem 'test-kitchen', '~> 1.1' | ||
gem 'kitchen-vagrant', '~> 0.14' | ||
gem 'test-kitchen', '~> 1.2.1' | ||
gem 'kitchen-vagrant', '~> 0.15.0' | ||
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 |
---|---|---|
@@ -1,37 +1,51 @@ | ||
#!/usr/bin/env rake | ||
|
||
require 'bundler/setup' | ||
|
||
# Style tests. Rubocop and Foodcritic | ||
namespace :style do | ||
require 'rubocop/rake_task' | ||
desc 'Run Ruby style checks' | ||
Rubocop::RakeTask.new(:ruby) | ||
begin | ||
require 'rubocop/rake_task' | ||
desc 'Run Ruby style checks' | ||
RuboCop::RakeTask.new(:ruby) | ||
rescue LoadError | ||
puts '>>>>> Rubocop gem not loaded, omitting tasks' unless ENV['CI'] | ||
end | ||
|
||
require 'foodcritic' | ||
desc 'Run Chef style checks' | ||
FoodCritic::Rake::LintTask.new(:chef) | ||
begin | ||
require 'foodcritic' | ||
|
||
desc 'Run Chef style checks' | ||
FoodCritic::Rake::LintTask.new(:chef) do |t| | ||
t.options = { | ||
fail_tags: ['any'] | ||
} | ||
end | ||
rescue LoadError | ||
puts '>>>>> foodcritic gem not loaded, omitting tasks' unless ENV['CI'] | ||
end | ||
end | ||
|
||
desc 'Run all style checks' | ||
task style: ['style:chef', 'style:ruby'] | ||
|
||
require 'rspec/core/rake_task' | ||
desc 'Run ChefSpec unit tests' | ||
RSpec::Core::RakeTask.new(:unit) do |t| | ||
t.rspec_opts = '--color --format progress' | ||
end | ||
# Integration tests. Kitchen.ci | ||
namespace :integration do | ||
begin | ||
require 'kitchen/rake_tasks' | ||
|
||
require 'kitchen' | ||
desc 'Run Test Kitchen integration tests' | ||
task :integration do | ||
Kitchen.logger = Kitchen.default_file_logger | ||
Kitchen::Config.new.instances.each do |instance| | ||
instance.test(:always) | ||
desc 'Run kitchen integration tests' | ||
Kitchen::RakeTasks.new | ||
rescue LoadError | ||
puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI'] | ||
end | ||
end | ||
|
||
# The default rake task should just run it all | ||
task default: %w(style unit integration) | ||
namespace :maintain do | ||
require 'stove/rake_task' | ||
Stove::RakeTask.new | ||
end | ||
|
||
desc 'Run all tests on Travis' | ||
task travis: ['style'] | ||
|
||
# Test task is for Travis, no integration tests | ||
task test: %w(style unit) | ||
# Default | ||
task default: ['style', 'integration:kitchen:all'] |