2d42da9cd8f7971d145857e2f1b0b99e2f1d0a8f
[integration/packaging/puppet-opendaylight.git] / Rakefile
1 require 'puppet/vendor/semantic/lib/semantic'
2 require 'puppetlabs_spec_helper/rake_tasks'
3 require 'puppet-lint/tasks/puppet-lint'
4 require 'puppet-syntax/tasks/puppet-syntax'
5
6 # These two gems aren't always present, for instance
7 # on Travis with --without development
8 begin
9   require 'puppet_blacksmith/rake_tasks'
10 rescue LoadError
11 end
12
13 PuppetLint.configuration.relative = true
14 PuppetLint.configuration.send("disable_80chars")
15 PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"
16 PuppetLint.configuration.fail_on_warnings = true
17
18 # Forsake support for Puppet 2.6.2 for the benefit of cleaner code.
19 # http://puppet-lint.com/checks/class_parameter_defaults/
20 PuppetLint.configuration.send('disable_class_parameter_defaults')
21 # http://puppet-lint.com/checks/class_inherits_from_params_class/
22 PuppetLint.configuration.send('disable_class_inherits_from_params_class')
23
24 exclude_paths = [
25   "bundle/**/*",
26   "pkg/**/*",
27   "vendor/**/*",
28   "spec/**/*",
29 ]
30 PuppetLint.configuration.ignore_paths = exclude_paths
31 PuppetSyntax.exclude_paths = exclude_paths
32
33 desc "Run acceptance tests"
34 RSpec::Core::RakeTask.new(:acceptance) do |t|
35   t.pattern = 'spec/acceptance'
36 end
37
38 task :metadata do
39   sh "metadata-json-lint metadata.json"
40 end
41
42 desc "Run syntax, lint, and spec tests."
43 task :test => [
44   :syntax,
45   :lint,
46   :spec,
47   :metadata,
48 ]