forked from voxpupuli/puppet-jenkins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
65 lines (56 loc) · 1.56 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
require 'rubygems'
require 'rake'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
require 'puppet-syntax/tasks/puppet-syntax'
require 'parallel_tests'
require 'parallel_tests/cli'
require 'rubocop/rake_task'
RuboCop::RakeTask.new
exclude_paths = [
'pkg/**/*',
'vendor/**/*',
'spec/**/*',
'contrib/**/*'
]
# Make sure we don't have the default rake task floating around
Rake::Task['lint'].clear
PuppetLint.configuration.relative = true
PuppetLint::RakeTask.new(:lint) do |l|
l.disable_checks = %w(80chars class_inherits_from_params_class)
l.ignore_paths = exclude_paths
l.fail_on_warnings = true
l.log_format = '%{path}:%{linenumber}:%{check}:%{KIND}:%{message}'
end
desc 'Run acceptance tests'
RSpec::Core::RakeTask.new(:acceptance) do |t|
t.pattern = 'spec/acceptance'
end
PuppetSyntax.exclude_paths = exclude_paths
namespace :travis do
desc 'Syntax check travis.yml'
task :lint do
# warnings are currently non-fatal due to suspected problems with
# validation of matrix::include
#sh "travis lint --exit-code" do |ok, res|
sh 'travis lint --skip-completion-check' do |ok, res|
unless ok
# exit without verbose rake error message
exit res.exitstatus
end
end
end
end
desc 'Parallel spec tests'
task :parallel_spec do
Rake::Task[:spec_prep].invoke
ParallelTests::CLI.new.run('--type test -t rspec spec/classes spec/defines spec/unit spec/functions'.split)
Rake::Task[:spec_clean].invoke
end
task :default => [
'travis:lint',
:rubocop,
:lint,
:validate,
:parallel_spec,
]