-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRakefile
63 lines (53 loc) · 1.3 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
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
require 'puppet-syntax/tasks/puppet-syntax'
# These gems aren't always present
begin
require 'puppet_blacksmith/rake_tasks'
rescue LoadError
end
test_tasks = [
:metadata,
:clean_fixtures,
:syntax,
:lint,
:validate,
:spec
]
PuppetLint.configuration.relative = true
PuppetLint.configuration.send("disable_80chars")
PuppetLint.configuration.fail_on_warnings = true
exclude_paths = [
"pkg/**/*",
"vendor/**/*",
".vendor/**/*",
"spec/**/*",
]
PuppetLint.configuration.ignore_paths = exclude_paths
PuppetSyntax.exclude_paths = exclude_paths
desc "Run acceptance tests"
RSpec::Core::RakeTask.new(:acceptance) do |t|
t.pattern = 'spec/acceptance'
end
begin
require 'inch/rake'
Inch::Rake::Suggest.new :inch, '--pedantic'
test_tasks << :inch
rescue LoadError
# do nothing
end
desc "Validate manifests, templates, and ruby files"
task :validate do
Dir['manifests/**/*.pp'].each do |manifest|
sh "puppet parser validate --noop #{manifest}"
end
Dir['templates/**/*.erb'].each do |template|
sh "erb -P -x -T '-' #{template} | ruby -c"
end
end
desc "Clean fixtures"
task :clean_fixtures do
FileUtils.rmtree 'spec/fixtures/modules'
end
desc "Run syntax, lint, and spec tests."
task :test => test_tasks