forked from puppetlabs/puppetlabs-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
37 lines (33 loc) · 1.1 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
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
begin
require 'beaker/tasks/test'
rescue LoadError
#Do nothing, rescue for Windows as beaker does not work and will not be installed
end
#Due to puppet-lint not ignoring tests folder or the ignore paths attribute
#we have to ignore many things
# #Due to bug in puppet-lint we have to clear and redo the lint tasks to achieve ignore paths
Rake::Task[:lint].clear
PuppetLint::RakeTask.new(:lint) do |config|
config.pattern = 'manifests/**/*.pp'
config.fail_on_warnings = true
config.disable_checks = [
'80chars',
'class_inherits_from_params_class',
'class_parameter_defaults',
'documentation',
'single_quote_string_with_variables']
config.ignore_paths = ["tests/*.pp", "spec/**/*.pp", "pkg/**/*.pp"]
end
task :default => [:test]
desc 'Run RSpec'
RSpec::Core::RakeTask.new(:test) do |t|
t.pattern = 'spec/{unit}/**/*.rb'
#t.rspec_opts = ['--color']
end
desc 'Generate code coverage'
RSpec::Core::RakeTask.new(:coverage) do |t|
t.rcov = true
t.rcov_opts = ['--exclude', 'spec']
end