From 5b45d1fede2648f7cefdcb31c7fb7986ad8533cc Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Wed, 18 Mar 2015 13:43:43 -0700 Subject: [PATCH 1/5] Update rspec tests for rspec-puppet 2 This patch uses `catalogue` instead of `subject` for the raise_error matcher since `subject` is not evaluated the way it used to be. We also unpin rspec-puppet. --- Gemfile | 1 - spec/classes/java_spec.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 62c5693..2452d15 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,6 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org" group :development, :unit_tests do gem 'rake', :require => false gem 'rspec-core', '3.1.7', :require => false - gem 'rspec-puppet', '~> 1.0', :require => false gem 'puppetlabs_spec_helper', :require => false gem 'puppet-lint', :require => false gem 'simplecov', :require => false diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 4b29825..3716684 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -181,7 +181,7 @@ describe 'java', :type => :class do ].each do |facts| let(:facts) { facts } it "should fail on #{facts[:operatingsystem]} #{facts[:operatingsystemrelease]}" do - expect { subject }.to raise_error Puppet::Error, /unsupported platform/ + expect { catalogue }.to raise_error Puppet::Error, /unsupported platform/ end end end From ce5529a03de05ee72e5b184dd56f89614676072f Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Wed, 18 Mar 2015 13:44:35 -0700 Subject: [PATCH 2/5] Remove unneeded dependencies puppetlabs_spec_helper handles these dependencies for us. --- Gemfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Gemfile b/Gemfile index 2452d15..cc77f38 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,8 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org" group :development, :unit_tests do - gem 'rake', :require => false gem 'rspec-core', '3.1.7', :require => false gem 'puppetlabs_spec_helper', :require => false - gem 'puppet-lint', :require => false gem 'simplecov', :require => false gem 'puppet_facts', :require => false gem 'json', :require => false From d0a03f66c7549a3965c29cff8af8c370ead44170 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Wed, 18 Mar 2015 13:45:29 -0700 Subject: [PATCH 3/5] Ensure lint fails on warnings --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index e3be95b..181157e 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,7 @@ require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-lint/tasks/puppet-lint' -PuppetLint.configuration.fail_on_warnings +PuppetLint.configuration.fail_on_warnings = true PuppetLint.configuration.send('relative') PuppetLint.configuration.send('disable_80chars') PuppetLint.configuration.send('disable_class_inherits_from_params_class') From 44a1992e83d3a816db8b5de5cf1e4147520e6342 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Mon, 23 Mar 2015 12:07:19 -0700 Subject: [PATCH 4/5] Keep testing on puppet 2.7 The modulesync config repo is dropping universal support for puppet 2.7, but individual repos should still keep support until the next naturally-occuring major release. --- .sync.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .sync.yml diff --git a/.sync.yml b/.sync.yml new file mode 100644 index 0000000..3dd0ca0 --- /dev/null +++ b/.sync.yml @@ -0,0 +1,7 @@ +--- +.travis.yml: + extras: + - rvm: 1.8.7 + env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0" + - rvm: 1.8.7 + env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0" From 8db7120eedf69025ca976c5fec4ec02d3cfc61da Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Mon, 23 Mar 2015 12:38:04 -0700 Subject: [PATCH 5/5] Update .travis.yml This commit makes the following changes to the test matrix: - Runs tests on ruby 2.1.5 instead of 2.0.0 - Runs tests on ruby 1.8.7 with puppet 3.x - Adds an environment to run on an intermediate 3.x puppet version instead of latest (specifically 3.4.x) - Adds an environment to run with the future parser on latest puppet. This would affect the test runs for the validate and spec checks. - Adds environments to run with strict variables on latest puppet. - Runs the tests on docker --- .travis.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6cf8b00..d1a0d7c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,28 @@ --- +sudo: false language: ruby bundler_args: --without system_tests script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'" matrix: fast_finish: true include: + - rvm: 1.9.3 + env: PUPPET_GEM_VERSION="~> 3.4.0" + - rvm: 1.8.7 + env: PUPPET_GEM_VERSION="~> 3.0" + - rvm: 1.9.3 + env: PUPPET_GEM_VERSION="~> 3.0" + - rvm: 1.9.3 + env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes" + - rvm: 2.1.5 + env: PUPPET_GEM_VERSION="~> 3.0" + - rvm: 2.1.5 + env: PUPPET_GEM_VERSION="~> 3.4.0" + - rvm: 2.1.5 + env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes" - rvm: 1.8.7 env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0" - rvm: 1.8.7 env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0" - - rvm: 1.9.3 - env: PUPPET_GEM_VERSION="~> 3.0" - - rvm: 2.0.0 - env: PUPPET_GEM_VERSION="~> 3.0" notifications: email: false