forked from test-kitchen/test-kitchen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
83 lines (71 loc) · 2.18 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# -*- encoding: utf-8 -*-
require "bundler/gem_tasks"
require "rake/testtask"
Rake::TestTask.new(:unit) do |t|
t.libs.push "lib"
t.test_files = FileList["spec/**/*_spec.rb"]
t.verbose = true
end
begin
require "cucumber"
require "cucumber/rake/task"
Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = ["features", "-x", "--format progress", "--no-color"]
end
rescue LoadError
puts "cucumber is not available. (sudo) gem install cucumber to run tests."
end
desc "Run all test suites"
task :test => [:unit, :features]
desc "Display LOC stats"
task :stats do
puts "\n## Production Code Stats"
sh "countloc -r lib/kitchen lib/kitchen.rb"
puts "\n## Test Code Stats"
sh "countloc -r spec features"
end
begin
require "finstyle"
require "rubocop/rake_task"
RuboCop::RakeTask.new(:style) do |task|
task.options += ["--display-cop-names", "--no-color"]
end
rescue LoadError
puts "finstyle/rubocop is not available. gem install finstyle to do style checking."
end
begin
if RUBY_ENGINE != "jruby"
require "cane/rake_task"
desc "Run cane to check quality metrics"
Cane::RakeTask.new do |cane|
cane.canefile = "./.cane"
end
desc "Run all quality tasks"
task :quality => [:cane, :style, :stats]
else
desc "Run all quality tasks"
task :quality => [:style, :stats]
end
rescue LoadError
puts "cane is not available. (sudo) gem install cane to check quality metrics."
end
begin
require "yard"
YARD::Rake::YardocTask.new
rescue LoadError
puts "yard is not available. (sudo) gem install yard to generate yard documentation."
end
task :default => [:test, :quality]
begin
require "github_changelog_generator/task"
require "kitchen/version"
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
config.future_release = "v#{Kitchen::VERSION}"
config.enhancement_labels = "enhancement,Enhancement,New Feature,Feature,Improvement".split(",")
config.bug_labels = "bug,Bug".split(",")
config.exclude_labels = %w[Duplicate Question Discussion No_Changelog]
end
rescue LoadError
puts "github_changelog_generator is not available." \
" gem install github_changelog_generator to generate changelogs"
end