From b30c81a72ae7cf24426b8cf568b567b8c53042b4 Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Mon, 22 Aug 2016 15:04:44 -0400 Subject: [PATCH 1/5] Fix TravisCI for Ruby < 2 --- Gemfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index f5b005b8..a386ea45 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,12 @@ else end if RUBY_VERSION >= '1.8.7' and RUBY_VERSION < '2.0' - gem 'json', '~> 1.0' + # json 2.x requires ruby 2.0. Lock to 1.8 + gem 'json', '~> 1.8' + # json_pure 2.0.2 requires ruby 2.0. Lock to 2.0.1 + gem 'json_pure', '= 2.0.1' +else + gem 'json' end if facterversion = ENV['FACTER_GEM_VERSION'] From 132ce39151c9401ded1c2a0bf3692da111ac9c2e Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Mon, 22 Aug 2016 15:05:41 -0400 Subject: [PATCH 2/5] Explicitly support Puppet v4.3, 4.4 and 4.5 --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.travis.yml b/.travis.yml index 749f64be..497f9c18 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,9 @@ env: - 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" sudo: false @@ -48,6 +51,12 @@ matrix: 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" From 880d2b3886f7f5c6d859c50324bdefef2377b0f4 Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Mon, 22 Aug 2016 15:07:12 -0400 Subject: [PATCH 3/5] Simplify CI tests by ensuring the use of a newer puppetlabs_spec_helper The new version handles checking the validity of metadata.json. With this we no longer need the `rake metadata_lint` as part of the CI process. --- .travis.yml | 2 +- Gemfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 497f9c18..1ad7b7b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ env: sudo: false -script: 'bundle exec metadata-json-lint metadata.json && bundle exec rake validate && bundle exec rake lint && SPEC_OPTS="--format documentation" bundle exec rake spec' +script: 'bundle exec rake validate && bundle exec rake lint && SPEC_OPTS="--format documentation" bundle exec rake spec' matrix: fast_finish: true diff --git a/Gemfile b/Gemfile index a386ea45..7dc524db 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org" group :development, :test do gem 'metadata-json-lint', :require => false gem 'rspec-puppet', :require => false - gem 'puppetlabs_spec_helper', :require => false + gem 'puppetlabs_spec_helper', '>= 1.1.1' gem 'puppet-lint', :require => false gem 'pry', :require => false gem 'simplecov', :require => false From ca882071fb1c018a320c398009ef7ab268660566 Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Mon, 22 Aug 2016 15:14:27 -0400 Subject: [PATCH 4/5] Fix existing bug in spec tests --- spec/defines/pip_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/defines/pip_spec.rb b/spec/defines/pip_spec.rb index d603edc8..e03fd7f1 100644 --- a/spec/defines/pip_spec.rb +++ b/spec/defines/pip_spec.rb @@ -48,7 +48,7 @@ context "adds proxy to search command if set to latest" do let (:params) {{ :proxy => "http://my.proxy:3128", :ensure => 'latest' }} it { is_expected.to contain_exec("pip_install_rpyc").with_command("pip wheel --help > /dev/null 2>&1 && { pip wheel --version > /dev/null 2>&1 || wheel_support_flag='--no-use-wheel'; } ; { pip --log /tmp/pip.log install --upgrade $wheel_support_flag --proxy=http://my.proxy:3128 rpyc || pip --log /tmp/pip.log install --upgrade --proxy=http://my.proxy:3128 rpyc ;}") } - it { is_expected.to contain_exec("pip_install_rpyc").with_unless('pip search --proxy=http://my.proxy:3128 rpyc | grep -i INSTALLED | grep -i latest') } + it { is_expected.to contain_exec("pip_install_rpyc").with_unless('pip search --proxy=http://my.proxy:3128 rpyc | grep -i INSTALLED.*latest') } end end From dd9af35ca28f4d589be807c7c3a633c600961462 Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Mon, 22 Aug 2016 15:14:41 -0400 Subject: [PATCH 5/5] Fix style --- manifests/install.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/install.pp b/manifests/install.pp index 69fde060..95e7009e 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -18,7 +18,7 @@ $python = $::python::version ? { 'system' => 'python', 'pypy' => 'pypy', - default => "${python::version}", + default => "${python::version}", # lint:ignore:only_variable_string } $pythondev = $::osfamily ? { @@ -220,8 +220,8 @@ } package { 'gunicorn': - name => $python::gunicorn_package_name, ensure => $gunicorn_ensure, + name => $python::gunicorn_package_name, } } }