Commit 8f46ebd6 authored by Tim Smith's avatar Tim Smith

Update testing

Signed-off-by: default avatarTim Smith <tsmith@chef.io>
parent 96079b6f
......@@ -6,7 +6,7 @@ provisioner:
platforms:
- name: centos-5.11
- name: centos-6.7
- name: centos-6.8
- name: centos-7.2
- name: fedora-23
......
source 'https://rubygems.org'
gem 'berkshelf', '~> 4.3'
gem 'chefspec', '~> 4.6'
gem 'cookstyle'
gem 'foodcritic', '~> 6.2'
gem 'kitchen-dokken'
gem 'kitchen-inspec', '~> 0.12'
gem 'kitchen-vagrant', '~> 0.20'
gem 'tomlrb'
gem 'rake'
gem 'stove'
gem 'test-kitchen', '~> 1.7'
gem 'tomlrb'
gem 'community_cookbook_releaser'
require 'rspec/core/rake_task'
require 'cookstyle'
require 'rubocop/rake_task'
require 'foodcritic'
require 'kitchen'
#!/usr/bin/env rake
require_relative 'tasks/maintainers'
# Style tests. Rubocop and Foodcritic
# Style tests. cookstyle (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']
}
begin
require 'cookstyle'
require 'rubocop/rake_task'
desc 'Run Ruby style checks'
RuboCop::RakeTask.new(:ruby)
rescue LoadError => e
puts ">>> Gem load error: #{e}, omitting style:ruby" unless ENV['CI']
end
begin
require 'foodcritic'
desc 'Run Chef style checks'
FoodCritic::Rake::LintTask.new(:chef) do |t|
t.options = {
fail_tags: ['any'],
progress: true
}
end
rescue LoadError
puts ">>> Gem load error: #{e}, omitting style:chef" unless ENV['CI']
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)
# ChefSpec
begin
require 'rspec/core/rake_task'
desc 'Run ChefSpec examples'
RSpec::Core::RakeTask.new(:spec)
rescue LoadError => e
puts ">>> Gem load error: #{e}, omitting spec" unless ENV['CI']
end
# 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
begin
require 'kitchen/rake_tasks'
desc 'Run kitchen integration tests'
Kitchen::RakeTasks.new
rescue LoadError => e
puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV['CI']
end
end
desc 'Run all tests on Travis'
task travis: %w(style spec)
namespace :supermarket do
begin
require 'stove/rake_task'
desc 'Publish cookbook to Supermarket with Stove'
Stove::RakeTask.new
rescue LoadError => e
puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV['CI']
end
end
# Default
task default: %w(style spec)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment