From 03617d60ec8bacf11a56c0690fa83270b2fbb322 Mon Sep 17 00:00:00 2001 From: Matthew Haughton <3flex@users.noreply.github.com> Date: Wed, 22 Jun 2016 21:06:22 -0400 Subject: [PATCH 1/6] lint: don't lint vendor directory --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index c2f0e10..df22893 100644 --- a/Rakefile +++ b/Rakefile @@ -16,4 +16,4 @@ PuppetLint.configuration.send('disable_class_inherits_from_params_class') PuppetLint.configuration.send('disable_class_parameter_defaults') PuppetLint.configuration.send('disable_documentation') PuppetLint.configuration.send('disable_single_quote_string_with_variables') -PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] +PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp", "vendor/**/*.pp"] From ee23449b066d80793d79fe32f08658496c3a127e Mon Sep 17 00:00:00 2001 From: Matthew Haughton <3flex@users.noreply.github.com> Date: Wed, 22 Jun 2016 22:01:33 -0400 Subject: [PATCH 2/6] lint:disable 140 char line check We have some failing tests, and in the Puppet Style Guide it's a SHOULD, not a MUST that lines be under this length --- Rakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Rakefile b/Rakefile index df22893..e0fd413 100644 --- a/Rakefile +++ b/Rakefile @@ -12,6 +12,7 @@ task :default => [:clean, :spec] PuppetLint.configuration.fail_on_warnings = true PuppetLint.configuration.send('relative') +PuppetLint.configuration.send('disable_140chars') PuppetLint.configuration.send('disable_class_inherits_from_params_class') PuppetLint.configuration.send('disable_class_parameter_defaults') PuppetLint.configuration.send('disable_documentation') From 17f3c54dc7542b266531bae9250a9234b3bca543 Mon Sep 17 00:00:00 2001 From: Matthew Haughton <3flex@users.noreply.github.com> Date: Wed, 22 Jun 2016 22:11:20 -0400 Subject: [PATCH 3/6] pin puppet-lint to 2.x Two reasons: 1. Newer is better! 2. Running lint < 2.0 with the current Rakefile will fail - lines longer than 80 chars will cause warnings, and Rakefile says to fail on warnings --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 42468eb..6c4870f 100644 --- a/Gemfile +++ b/Gemfile @@ -14,7 +14,7 @@ end group :rake do gem 'rspec-puppet', '>=2.1.0', :require => false gem 'rake', '>=0.9.2.2' - gem 'puppet-lint', '>=1.0.1' + gem 'puppet-lint', '~> 2.0' end if puppetversion = ENV['PUPPET_GEM_VERSION'] From f451bd3bdbc9e146a08d9b6053e8913f8ef3cae4 Mon Sep 17 00:00:00 2001 From: Matthew Haughton <3flex@users.noreply.github.com> Date: Wed, 22 Jun 2016 22:23:02 -0400 Subject: [PATCH 4/6] tidy up the gemfile * Moves beaker dependencies to system_tests group * pin puppetlabs_spec_helper and rspec-puppet to compatible versions, which should minimize future breakage * removed explicit dependency on rake --- Gemfile | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/Gemfile b/Gemfile index 6c4870f..99014ac 100644 --- a/Gemfile +++ b/Gemfile @@ -1,20 +1,16 @@ source 'https://rubygems.org' -group :test do - gem 'rest-client', '~> 1.6.8', :require => false, :platforms => :ruby_18 -end - -group :rake, :test do - gem 'puppetlabs_spec_helper', '>=0.8.2', :require => false - gem 'puppet-blacksmith', :require => false - gem 'beaker', :require => false - gem 'beaker-rspec', :require => false -end - group :rake do - gem 'rspec-puppet', '>=2.1.0', :require => false - gem 'rake', '>=0.9.2.2' - gem 'puppet-lint', '~> 2.0' + gem 'puppetlabs_spec_helper', '~> 1.1', :require => false + gem 'rspec-puppet', '~> 2.3', :require => false + gem 'puppet-lint', '~> 2.0', :require => false + gem 'puppet-blacksmith', :require => false + gem 'rake', :require => false +end + +group :system_tests do + gem 'beaker-rspec', :require => false + gem 'beaker', :require => false end if puppetversion = ENV['PUPPET_GEM_VERSION'] From 97f0aca2ba883df57ff2cf70eb9af0121fe3f26a Mon Sep 17 00:00:00 2001 From: Matthew Haughton <3flex@users.noreply.github.com> Date: Wed, 22 Jun 2016 22:34:57 -0400 Subject: [PATCH 5/6] travis: build without system_tests --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7a03776..e84e077 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ sudo: false language: ruby cache: bundler script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'" -bundler_args: --without rake +bundler_args: --without system_tests matrix: fast_finish: true include: From a2164a6467af5f5aead2de1673ed3b8c6f8338c7 Mon Sep 17 00:00:00 2001 From: Matthew Haughton <3flex@users.noreply.github.com> Date: Wed, 22 Jun 2016 22:51:39 -0400 Subject: [PATCH 6/6] fix tests that fail on puppet 4.5+ --- spec/classes/nginx_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/classes/nginx_spec.rb b/spec/classes/nginx_spec.rb index 114fbeb..b5b9811 100644 --- a/spec/classes/nginx_spec.rb +++ b/spec/classes/nginx_spec.rb @@ -21,11 +21,11 @@ describe 'nginx' do it { is_expected.to compile.with_all_deps } it { is_expected.to contain_class('nginx') } it { is_expected.to contain_anchor('nginx::begin') } - it { is_expected.to contain_nginx__package.that_requires('Anchor[nginx::begin]') } - it { is_expected.to contain_nginx__config.that_requires('Class[nginx::package]') } - it { is_expected.to contain_nginx__service.that_subscribes_to('Anchor[nginx::begin]') } - it { is_expected.to contain_nginx__service.that_subscribes_to('Class[nginx::package]') } - it { is_expected.to contain_nginx__service.that_subscribes_to('Class[nginx::config]') } + it { is_expected.to contain_class('nginx::package').that_requires('Anchor[nginx::begin]') } + it { is_expected.to contain_class('nginx::config').that_requires('Class[nginx::package]') } + it { is_expected.to contain_class('nginx::service').that_subscribes_to('Anchor[nginx::begin]') } + it { is_expected.to contain_class('nginx::service').that_subscribes_to('Class[nginx::package]') } + it { is_expected.to contain_class('nginx::service').that_subscribes_to('Class[nginx::config]') } it { is_expected.to contain_anchor('nginx::end').that_requires('Class[nginx::service]') } it { is_expected.to contain_nginx__resource__upstream("upstream1") } it { is_expected.to contain_nginx__resource__vhost("test2.local") }