-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
47 lines (37 loc) · 1.08 KB
/
Rakefile
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
require 'rspec/core/rake_task'
# syntax/lint checks: RuboCop & Foodcritic
namespace :lint do
require 'rubocop/rake_task'
require 'foodcritic'
desc 'Run Ruby syntax/lint checks'
RuboCop::RakeTask.new(:ruby)
desc 'Run Chef syntax/lint checks'
FoodCritic::Rake::LintTask.new(:chef) do |task|
task.options = {
:fail_tags => ['any']
}
end
end
desc 'Run all syntax/lint checks'
task :lint => ['lint:ruby', 'lint:chef']
# unit testing: ChefSpec
desc 'Run RSpec and ChefSpec unit tests'
RSpec::Core::RakeTask.new(:unit)
# integration testing: Test Kitchen
namespace :integration do
require 'kitchen'
desc 'Run Test Kitchen integration tests with Vagrant'
task :vagrant do
Kitchen.logger = Kitchen.default_file_logger
Kitchen::Config.new.instances.each do |instance|
instance.test(:always)
end
end
end
desc 'Run all integration tests'
task :integration => ['integration:vagrant']
# Travic CI
desc 'Run tests on Travis CI'
task :travis => [:lint, :unit]
# the default rake task should just run it all
task :default => [:lint, :unit, :integration]