Browse Source

Initial msync run for all Puppet OpenStack modules

This patch is the initial modulesync run, it impacts:

* gitignore: just a sync between projects
* gemfile:
  - update and allow to setup facter version and gem source
  - split beaker gems with a dedicated group
  - switch to rspec-puppet 2.2.0
* rakefile:
  - use the new syntax for lint configuration
  - add a acceptance target
* acceptance:
  - sync nodesets
* spec: added rspec coverage report

Change-Id: Ib75add2af3380d0b1d4ce320b58df22b6c3ffa57
tags/7.0.0
Cody Herriges 3 years ago
parent
commit
4fa9985f2a

+ 8
- 3
.gitignore View File

@@ -1,5 +1,10 @@
1
+pkg/
1 2
 Gemfile.lock
2
-spec/fixtures/modules/*
3
-spec/fixtures/manifests/site.pp
3
+vendor/
4
+spec/fixtures/
5
+.vagrant/
6
+.bundle/
7
+coverage/
8
+.idea/
4 9
 *.swp
5
-pkg
10
+*.iml

+ 23
- 18
Gemfile View File

@@ -1,25 +1,30 @@
1
-source 'https://rubygems.org'
1
+source ENV['GEM_SOURCE'] || "https://rubygems.org"
2 2
 
3 3
 group :development, :test do
4
-  gem 'puppetlabs_spec_helper', :require => false
5
-  gem 'rspec-puppet', '~> 2.1.0', :require => false
6
-
7
-  gem 'metadata-json-lint'
8
-  gem 'puppet-lint-param-docs'
9
-  gem 'puppet-lint-absolute_classname-check'
10
-  gem 'puppet-lint-absolute_template_path'
11
-  gem 'puppet-lint-trailing_newline-check'
4
+  gem 'puppetlabs_spec_helper',               :require => 'false'
5
+  gem 'rspec-puppet', '~> 2.2.0',             :require => 'false'
6
+  gem 'metadata-json-lint',                   :require => 'false'
7
+  gem 'puppet-lint-param-docs',               :require => 'false'
8
+  gem 'puppet-lint-absolute_classname-check', :require => 'false'
9
+  gem 'puppet-lint-absolute_template_path',   :require => 'false'
10
+  gem 'puppet-lint-trailing_newline-check',   :require => 'false'
11
+  gem 'puppet-lint-unquoted_string-check',    :require => 'false'
12
+  gem 'puppet-lint-leading_zero-check',       :require => 'false'
13
+  gem 'puppet-lint-variable_contains_upcase', :require => 'false'
14
+  gem 'puppet-lint-numericvariable',          :require => 'false'
15
+  gem 'json',                                 :require => 'false'
16
+  gem 'webmock',                              :require => 'false'
17
+end
12 18
 
13
-  # Puppet 4.x related lint checks
14
-  gem 'puppet-lint-unquoted_string-check'
15
-  gem 'puppet-lint-leading_zero-check'
16
-  gem 'puppet-lint-variable_contains_upcase'
17
-  gem 'puppet-lint-numericvariable'
19
+group :system_tests do
20
+  gem 'beaker-rspec',                 :require => 'false'
21
+  gem 'beaker-puppet_install_helper', :require => 'false'
22
+end
18 23
 
19
-  gem 'beaker-rspec', :require => false
20
-  gem 'beaker-puppet_install_helper', :require => false
21
-  gem 'json'
22
-  gem 'webmock'
24
+if facterversion = ENV['FACTER_GEM_VERSION']
25
+  gem 'facter', facterversion, :require => false
26
+else
27
+  gem 'facter', :require => false
23 28
 end
24 29
 
25 30
 if puppetversion = ENV['PUPPET_GEM_VERSION']

+ 18
- 3
Rakefile View File

@@ -1,6 +1,21 @@
1 1
 require 'puppetlabs_spec_helper/rake_tasks'
2 2
 require 'puppet-lint/tasks/puppet-lint'
3
+require 'puppet-syntax/tasks/puppet-syntax'
3 4
 
4
-PuppetLint.configuration.fail_on_warnings = true
5
-PuppetLint.configuration.send('disable_80chars')
6
-PuppetLint.configuration.send('disable_class_parameter_defaults')
5
+PuppetSyntax.exclude_paths ||= []
6
+PuppetSyntax.exclude_paths << "spec/fixtures/**/*"
7
+PuppetSyntax.exclude_paths << "pkg/**/*"
8
+PuppetSyntax.exclude_paths << "vendor/**/*"
9
+
10
+Rake::Task[:lint].clear
11
+PuppetLint::RakeTask.new :lint do |config|
12
+  config.ignore_paths = ["spec/**/*.pp", "vendor/**/*.pp"]
13
+  config.fail_on_warnings = true
14
+  config.log_format = '%{path}:%{linenumber}:%{KIND}: %{message}'
15
+  config.disable_checks = ["80chars", "class_inherits_from_params_class", "class_parameter_defaults", "only_variable_string"]
16
+end
17
+
18
+desc "Run acceptance tests"
19
+RSpec::Core::RakeTask.new(:acceptance) do |t|
20
+  t.pattern = 'spec/acceptance'
21
+end

+ 11
- 0
spec/acceptance/nodesets/centos-70-x64.yml View File

@@ -0,0 +1,11 @@
1
+HOSTS:
2
+  centos-server-70-x64:
3
+    roles:
4
+      - master
5
+    platform: el-7-x86_64
6
+    box: puppetlabs/centos-7.0-64-nocm
7
+    box_url: https://vagrantcloud.com/puppetlabs/centos-7.0-64-nocm
8
+    hypervisor: vagrant
9
+CONFIG:
10
+  log_level: debug
11
+  type: foss

+ 4
- 3
spec/acceptance/nodesets/default.yml View File

@@ -1,9 +1,10 @@
1 1
 HOSTS:
2
-  ubuntu-14.04-amd64:
2
+  ubuntu-server-14.04-amd64:
3 3
     roles:
4 4
       - master
5 5
     platform: ubuntu-14.04-amd64
6
-    hypervisor : none
7
-    ip: 127.0.0.1
6
+    box: puppetlabs/ubuntu-14.04-64-nocm
7
+    box_url: https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm
8
+    hypervisor: vagrant
8 9
 CONFIG:
9 10
   type: foss

+ 1
- 1
spec/acceptance/nodesets/nodepool-centos7.yml View File

@@ -3,7 +3,7 @@ HOSTS:
3 3
     roles:
4 4
       - master
5 5
     platform: el-7-x86_64
6
-    hypervisor : none
6
+    hypervisor: none
7 7
     ip: 127.0.0.1
8 8
 CONFIG:
9 9
   type: foss

+ 1
- 1
spec/acceptance/nodesets/nodepool-trusty.yml View File

@@ -3,7 +3,7 @@ HOSTS:
3 3
     roles:
4 4
       - master
5 5
     platform: ubuntu-14.04-amd64
6
-    hypervisor : none
6
+    hypervisor: none
7 7
     ip: 127.0.0.1
8 8
 CONFIG:
9 9
   type: foss

+ 11
- 0
spec/acceptance/nodesets/ubuntu-server-1404-x64.yml View File

@@ -0,0 +1,11 @@
1
+HOSTS:
2
+  ubuntu-server-14.04-amd64:
3
+    roles:
4
+      - master
5
+    platform: ubuntu-14.04-amd64
6
+    box: puppetlabs/ubuntu-14.04-64-nocm
7
+    box_url: https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm
8
+    hypervisor: vagrant
9
+CONFIG:
10
+  log_level: debug
11
+  type: foss

+ 2
- 1
spec/spec_helper.rb View File

@@ -1,9 +1,10 @@
1 1
 require 'puppetlabs_spec_helper/module_spec_helper'
2 2
 require 'shared_examples'
3 3
 require 'webmock/rspec'
4
-require 'json'
5 4
 
6 5
 RSpec.configure do |c|
7 6
   c.alias_it_should_behave_like_to :it_configures, 'configures'
8 7
   c.alias_it_should_behave_like_to :it_raises, 'raises'
9 8
 end
9
+
10
+at_exit { RSpec::Puppet::Coverage.report! }

Loading…
Cancel
Save