Add WriteGoodLintBear support
[integration/packaging/puppet-opendaylight.git] / Rakefile
1 # Temporary fix for error caused by third party gems. See:
2 # https://github.com/maestrodev/puppet-blacksmith/issues/14
3 # https://github.com/dfarrell07/puppet-opendaylight/issues/6
4 require 'puppet/version'
5 require 'puppet/vendor/semantic/lib/semantic' unless Puppet.version.to_f <3.6
6
7 require 'puppetlabs_spec_helper/rake_tasks'
8 require 'puppet-lint/tasks/puppet-lint'
9 require 'puppet-syntax/tasks/puppet-syntax'
10
11 PuppetLint.configuration.relative = true
12 PuppetLint.configuration.send("disable_80chars")
13 PuppetLint.configuration.log_format = "%{path}:%{line}:%{check}:%{KIND}:%{message}"
14 PuppetLint.configuration.fail_on_warnings = true
15
16 # Forsake support for Puppet 2.6.2 for the benefit of cleaner code.
17 # http://puppet-lint.com/checks/class_parameter_defaults/
18 PuppetLint.configuration.send('disable_class_parameter_defaults')
19 # http://puppet-lint.com/checks/class_inherits_from_params_class/
20 PuppetLint.configuration.send('disable_class_inherits_from_params_class')
21
22 exclude_paths = [
23   "bundle/**/*",
24   "pkg/**/*",
25   "vendor/**/*",
26   "spec/**/*",
27 ]
28 PuppetLint.configuration.ignore_paths = exclude_paths
29 PuppetSyntax.exclude_paths = exclude_paths
30
31 # Linting
32
33 task :metadata_lint do
34   sh "metadata-json-lint metadata.json"
35 end
36
37 # CentOS VMs
38
39 desc "Beaker tests against CentOS 7 VM with latest Carbon testing RPM"
40 task :cent_6test_vm do
41   sh "RS_SET=centos-7 RPM_REPO='opendaylight-6-testing' bundle exec rake beaker"
42 end
43
44 # CentOS Containers
45
46 desc "Beaker tests against CentOS 7 container with latest Carbon testing RPM"
47 task :cent_6test_dock do
48   sh "RS_SET=centos-7-docker RPM_REPO='opendaylight-6-testing' bundle exec rake beaker"
49 end
50
51 # Ubuntu VMs
52
53 desc "Beaker tests against Ubuntu 16.04 Container with Boron release Deb"
54 task :ubuntu_6test_vm do
55   sh "RS_SET=ubuntu-16 DEB_REPO='ppa:odl-team/carbon' bundle exec rake beaker"
56 end
57
58 # Ubuntu Containers
59
60 desc "Beaker tests against Ubuntu 16.04 Container with Boron release Deb"
61 task :ubuntu_6test_dock do
62   sh "RS_SET=ubuntu-16-docker DEB_REPO='ppa:odl-team/carbon' bundle exec rake beaker"
63 end
64
65 # Multi-test helpers
66
67 desc "Run syntax, lint, and spec tests."
68 task :test => [
69   :syntax,
70   :lint,
71   :metadata_lint,
72   :spec,
73 ]
74
75 desc "Quick and important tests"
76 task :sanity=> [
77   :test,
78   :cent_6test_dock,
79 ]
80
81 desc "All tests, use VMs for Beaker tests"
82 task :acceptance_vm => [
83   :test,
84   :ubuntu_6test_vm,
85   :cent_6test_vm,
86 ]
87
88 desc "All tests, use containers for Beaker tests"
89 task :acceptance_dock => [
90   :test,
91   :ubuntu_6test_dock,
92   :cent_6test_dock,
93 ]