From 5e5cc2cb58264b0d0d0909335c924ea995b37429 Mon Sep 17 00:00:00 2001 From: Phil Friderici Date: Mon, 10 Dec 2018 11:29:53 +0000 Subject: [PATCH 1/3] Stop testing on minor releases, support only latest Puppet versions --- .travis.yml | 116 +++++++++++++--------------------------------------- Gemfile | 46 +++++++++++---------- Rakefile | 13 +++--- 3 files changed, 59 insertions(+), 116 deletions(-) diff --git a/.travis.yml b/.travis.yml index 53546cd..53de5e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,35 +1,17 @@ --- language: ruby -rvm: - - 1.8.7 - - 1.9.3 - - 2.0.0 - - 2.1.0 - - 2.3.1 +bundler_args: --without system_tests development -env: - matrix: - - PUPPET_GEM_VERSION="~> 3.1.0" - - PUPPET_GEM_VERSION="~> 3.2.0" - - PUPPET_GEM_VERSION="~> 3.3.0" - - PUPPET_GEM_VERSION="~> 3.4.0" - - PUPPET_GEM_VERSION="~> 3.5.0" - - PUPPET_GEM_VERSION="~> 3.6.0" - - PUPPET_GEM_VERSION="~> 3.7.0" - - PUPPET_GEM_VERSION="~> 3.8.0" - - PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" - - PUPPET_GEM_VERSION="~> 4.0.0" - - PUPPET_GEM_VERSION="~> 4.1.0" - - PUPPET_GEM_VERSION="~> 4.2.0" - - PUPPET_GEM_VERSION="~> 4.3.0" - - PUPPET_GEM_VERSION="~> 4.4.0" - - PUPPET_GEM_VERSION="~> 4.5.0" - - PUPPET_GEM_VERSION="~> 4.6.0" - - PUPPET_GEM_VERSION="~> 4.7.0" - - PUPPET_GEM_VERSION="~> 4.8.0" - - PUPPET_GEM_VERSION="~> 4.9.0" - - PUPPET_GEM_VERSION="~> 4" +cache: bundler + +before_install: + - bundle -v + - rm Gemfile.lock || true + - gem update --system + - gem update bundler + - gem --version + - bundle -v sudo: false @@ -37,65 +19,25 @@ script: 'SPEC_OPTS="--format documentation" bundle exec rake validate lint spec' matrix: fast_finish: true - exclude: - - rvm: 2.0.0 - env: PUPPET_GEM_VERSION="~> 3.1.0" - - rvm: 2.1.0 - env: PUPPET_GEM_VERSION="~> 3.1.0" - - rvm: 2.1.0 - env: PUPPET_GEM_VERSION="~> 3.2.0" - - rvm: 2.1.0 - env: PUPPET_GEM_VERSION="~> 3.3.0" - - rvm: 2.1.0 - env: PUPPET_GEM_VERSION="~> 3.4.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.0.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.1.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.2.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.3.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.4.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.5.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.6.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.7.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.8.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.9.0" - - rvm: 1.9.3 - env: PUPPET_GEM_VERSION="~> 4.9.0" - - rvm: 2.0.0 - env: PUPPET_GEM_VERSION="~> 4.9.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4" - - rvm: 1.9.3 - env: PUPPET_GEM_VERSION="~> 4" - - rvm: 2.0.0 - env: PUPPET_GEM_VERSION="~> 4" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.1.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.2.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.3.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.4.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.5.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.6.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.7.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.8.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" + include: + - rvm: 1.8.7 + env: PUPPET_GEM_VERSION="~> 3" + - rvm: 1.8.7 + env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" + - rvm: 1.9.3 + env: PUPPET_GEM_VERSION="~> 3" + - rvm: 1.9.3 + env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" + - rvm: 2.0.0 + env: PUPPET_GEM_VERSION="~> 3" + - rvm: 2.0.0 + env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" + - rvm: 2.1.9 + env: PUPPET_GEM_VERSION="~> 3" + - rvm: 2.1.9 + env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" + - rvm: 2.1.9 + env: PUPPET_GEM_VERSION="~> 4" notifications: email: false diff --git a/Gemfile b/Gemfile index 57f5d73..ca6cc29 100644 --- a/Gemfile +++ b/Gemfile @@ -6,25 +6,29 @@ else gem 'puppet', :require => false end -gem 'puppetlabs_spec_helper', '>= 1.2.0' -gem 'facter', '>= 1.7.0' -gem 'rspec-puppet' -gem 'puppet-lint', '~> 2.0' -gem 'puppet-lint-absolute_classname-check' -gem 'puppet-lint-alias-check' -gem 'puppet-lint-empty_string-check' -gem 'puppet-lint-file_ensure-check' -gem 'puppet-lint-file_source_rights-check' -gem 'puppet-lint-leading_zero-check' -gem 'puppet-lint-spaceship_operator_without_tag-check' -gem 'puppet-lint-trailing_comma-check' -gem 'puppet-lint-undef_in_function-check' -gem 'puppet-lint-unquoted_string-check' -gem 'puppet-lint-variable_contains_upcase' +gem 'facter', '>= 1.7.0', :require => false +gem 'rspec-puppet', '>= 2.4.0', :require => false +gem 'puppet-lint', '~> 2.0', :require => false +gem 'puppet-lint-absolute_classname-check', :require => false +gem 'puppet-lint-alias-check', :require => false +gem 'puppet-lint-empty_string-check', :require => false +gem 'puppet-lint-file_ensure-check', :require => false +gem 'puppet-lint-file_source_rights-check', :require => false +gem 'puppet-lint-leading_zero-check', :require => false +gem 'puppet-lint-spaceship_operator_without_tag-check', :require => false +gem 'puppet-lint-trailing_comma-check', :require => false +gem 'puppet-lint-undef_in_function-check', :require => false +gem 'puppet-lint-unquoted_string-check', :require => false +gem 'puppet-lint-variable_contains_upcase', :require => false -gem 'rspec', '~> 2.0' if RUBY_VERSION >= '1.8.7' and RUBY_VERSION < '1.9' -gem 'rake', '~> 10.0' if RUBY_VERSION >= '1.8.7' and RUBY_VERSION < '1.9' -gem 'json', '<= 1.8' if RUBY_VERSION < '2.0.0' -gem 'json_pure', '<= 2.0.1' if RUBY_VERSION < '2.0.0' -gem 'metadata-json-lint', '0.0.11' if RUBY_VERSION < '1.9' -gem 'metadata-json-lint' if RUBY_VERSION >= '1.9' +gem 'rspec', '~> 2.0', :require => false if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' +gem 'rake', '~> 10.0', :require => false if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' +gem 'json', '<= 1.8', :require => false if RUBY_VERSION < '2.0.0' +gem 'json_pure', '<= 2.0.1', :require => false if RUBY_VERSION < '2.0.0' +gem 'metadata-json-lint', '0.0.11' if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' +gem 'metadata-json-lint', '1.0.0' if RUBY_VERSION >= '1.9' && RUBY_VERSION < '2.0' +gem 'metadata-json-lint' if RUBY_VERSION >= '2.0' + +gem 'puppetlabs_spec_helper', '2.0.2', :require => false if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' +gem 'puppetlabs_spec_helper', '>= 2.0.0', :require => false if RUBY_VERSION >= '1.9' +gem 'parallel_tests', '<= 2.9.0', :require => false if RUBY_VERSION < '2.0.0' diff --git a/Rakefile b/Rakefile index f2f0456..5fe42a7 100644 --- a/Rakefile +++ b/Rakefile @@ -3,17 +3,14 @@ require 'puppet-lint/tasks/puppet-lint' PuppetLint.configuration.send('disable_80chars') PuppetLint.configuration.send('disable_140chars') PuppetLint.configuration.relative = true -PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] +PuppetLint.configuration.ignore_paths = ['spec/**/*.pp', 'pkg/**/*.pp', 'vendor/**/*.pp'] -desc 'Validate manifests, templates, and ruby files' +desc 'Validate manifests, templates, ruby files and shell scripts' task :validate do - Dir['manifests/**/*.pp'].each do |manifest| - sh "puppet parser validate --noop #{manifest}" - end - Dir['spec/**/*.rb','lib/**/*.rb'].each do |ruby_file| + Dir['spec/**/*.rb', 'lib/**/*.rb'].each do |ruby_file| sh "ruby -c #{ruby_file}" unless ruby_file =~ /spec\/fixtures/ end - Dir['templates/**/*.erb'].each do |template| - sh "erb -P -x -T '-' #{template} | ruby -c" + Dir['files/**/*.sh'].each do |shell_script| + sh "bash -n #{shell_script}" end end From 2f64e3822873b7fce65c012689c8808fa6a6be66 Mon Sep 17 00:00:00 2001 From: Phil Friderici Date: Mon, 10 Dec 2018 11:30:37 +0000 Subject: [PATCH 2/3] Remove deprecation warning caused by puppetlabs_spec_helper Deprecation Warnings: puppetlabs_spec_helper: defaults `mock_with` to `:mocha`. See https://github.com/puppetlabs/puppetlabs_spec_helper#mock_with to choose a sensible value for you --- spec/spec_helper.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0877a51..76ffa04 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,7 @@ +RSpec.configure do |c| + c.mock_with :rspec +end + require 'puppetlabs_spec_helper/module_spec_helper' RSpec.configure do |config| From fac2daa912286b2f0f55334ed498d865fb0f561a Mon Sep 17 00:00:00 2001 From: Phil Friderici Date: Mon, 10 Dec 2018 11:31:37 +0000 Subject: [PATCH 3/3] Add support for Puppet 5 & 6 --- .travis.yml | 4 ++++ README.md | 6 +++--- metadata.json | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 53de5e1..9b113b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,6 +38,10 @@ matrix: env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" - rvm: 2.1.9 env: PUPPET_GEM_VERSION="~> 4" + - rvm: 2.4.1 + env: PUPPET_GEM_VERSION="~> 5" + - rvm: 2.5.1 + env: PUPPET_GEM_VERSION="~> 6" notifications: email: false diff --git a/README.md b/README.md index 40b5b9b..fd33b45 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ This module will ensure that sysklogd is absent, which is needed on EL5. # Compatibility # -This module has been tested to work on the following systems with Puppet -v3 (with and without the future parser) and Puppet v4 with Ruby versions -1.8.7, 1.9.3, 2.0.0, 2.1.0 and 2.3.1. +This module has been tested to work on the following systems with the +latest Puppet v3, v3 with future parser, v4, v5 and v6. See `.travis.yml` +for the exact matrix of supported Puppet and ruby versions. * Debian 7 * EL 5 diff --git a/metadata.json b/metadata.json index 8e3f968..51cefd9 100644 --- a/metadata.json +++ b/metadata.json @@ -9,7 +9,7 @@ "issues_url": "https://github.com/ghoneycutt/puppet-module-rsyslog/issues", "description": "Manage rsyslog", "requirements": [ - {"name":"puppet", "version_requirement": ">= 3.0.0 < 5.0.0" } + {"name":"puppet", "version_requirement": ">= 3.0.0 < 7.0.0" } ], "operatingsystem_support": [ {