e7a176a0850fa729df8c3a5a43eff9e42696cf8d
[integration/packaging/puppet-opendaylight.git] / Rakefile
1 require 'puppetlabs_spec_helper/rake_tasks'
2 require 'puppet-lint/tasks/puppet-lint'
3 require 'puppet-syntax/tasks/puppet-syntax'
4
5 PuppetLint.configuration.relative = true
6 PuppetLint.configuration.send("disable_80chars")
7 PuppetLint.configuration.log_format = "%{path}:%{line}:%{check}:%{KIND}:%{message}"
8 PuppetLint.configuration.fail_on_warnings = true
9
10 exclude_paths = [
11   "bundle/**/*",
12   "pkg/**/*",
13   "vendor/**/*",
14   "spec/**/*",
15 ]
16 PuppetLint.configuration.ignore_paths = exclude_paths
17 PuppetSyntax.exclude_paths = exclude_paths
18
19 # Linting
20
21 task :metadata_lint do
22   sh "metadata-json-lint metadata.json"
23 end
24
25 # CentOS VMs
26
27 desc "Beaker tests against CentOS 7 VM with latest Carbon testing RPM"
28 task :cent_6test_vm do
29   sh "RS_SET=centos-7 RPM_REPO='opendaylight-6-testing' bundle exec rake beaker"
30 end
31
32 # CentOS Containers
33
34 desc "Beaker tests against CentOS 7 container with latest Carbon testing RPM"
35 task :cent_6test_dock do
36   sh "RS_SET=centos-7-docker RPM_REPO='opendaylight-6-testing' bundle exec rake beaker"
37 end
38
39 # Ubuntu VMs
40
41 desc "Beaker tests against Ubuntu 16.04 Container with Boron release Deb"
42 task :ubuntu_6test_vm do
43   sh "RS_SET=ubuntu-16 DEB_REPO='ppa:odl-team/carbon' bundle exec rake beaker"
44 end
45
46 # Ubuntu Containers
47
48 desc "Beaker tests against Ubuntu 16.04 Container with Boron release Deb"
49 task :ubuntu_6test_dock do
50   sh "RS_SET=ubuntu-16-docker DEB_REPO='ppa:odl-team/carbon' bundle exec rake beaker"
51 end
52
53 # Multi-test helpers
54
55 desc "Run syntax, lint, and spec tests."
56 task :test => [
57   :syntax,
58   :lint,
59   :metadata_lint,
60   :spec,
61 ]
62
63 desc "Quick and important tests"
64 task :sanity=> [
65   :test,
66   :cent_6test_dock,
67 ]
68
69 desc "All tests, use VMs for Beaker tests"
70 task :acceptance_vm => [
71   :test,
72   :ubuntu_6test_vm,
73   :cent_6test_vm,
74 ]
75
76 desc "All tests, use containers for Beaker tests"
77 task :acceptance_dock => [
78   :test,
79   :ubuntu_6test_dock,
80   :cent_6test_dock,
81 ]