-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
29 lines (26 loc) · 746 Bytes
/
Copy pathRakefile
File metadata and controls
29 lines (26 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'rspec/core/rake_task'
require 'kitchen'
require 'foodcritic'
require 'cookbook-release'
FoodCritic::Rake::LintTask.new
RSpec::Core::RakeTask.new(:rspec)
CookbookRelease::Rake::CookbookTask.new
desc 'Run kitchen tests'
task :test_kitchen do
Kitchen.logger = Kitchen.default_file_logger
@loader = Kitchen::Loader::YAML.new(project_config: './.kitchen.ec2.yml')
config = Kitchen::Config.new(loader: @loader)
if ENV['KITCHEN_NO_CONCURRENCY']
config.instances.each do |instance|
instance.test(:always)
end
else
threads = []
config.instances.each do |instance|
threads << Thread.new { instance.test(:always) }
end
threads.map(&:join)
end
end
tasks = [:foodcritic, :rspec]
task default: tasks