forked from bdangit/chef-influxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
54 lines (46 loc) · 1.23 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
48
49
50
51
52
53
54
require 'rake'
require 'rake/testtask'
require 'rubocop/rake_task'
require 'foodcritic'
task default: 'test:quick'
namespace :test do
RuboCop::RakeTask.new
Rake::TestTask.new do |t|
t.name = :minitest
t.test_files = Dir.glob('test/spec/**/*_spec.rb')
end
FoodCritic::Rake::LintTask.new do |t|
t.name = :foodcritic
t.options = {
fail_tags: ['any'],
tags: ['~FC001', '~FC007', '~FC017']
}
end
begin
require 'kitchen'
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
end
rescue LoadError
puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI']
end
desc 'Run all of the quick tests.'
task :quick do
Rake::Task['test:rubocop'].invoke
Rake::Task['test:minitest'].invoke
Rake::Task['test:foodcritic'].invoke
end
desc 'Run all tests, including test-kitchen.'
task :complete do
Rake::Task['test:rubocop'].invoke
Rake::Task['test:minitest'].invoke
Rake::Task['test:foodcritic'].invoke
Rake::Task['test:integration:vagrant'].invoke
end
end