From b160a34707028505ed7944d89a39a8b61eceacf5 Mon Sep 17 00:00:00 2001 From: Eric Thompson Date: Mon, 3 Apr 2017 16:35:33 -0700 Subject: [PATCH 01/12] (maint) remove bundler/gem_tasks from Rakefile * i guess we never got around to adding Gem building tasks --- Rakefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Rakefile b/Rakefile index b2f8359..46f3a2d 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,3 @@ -require "bundler/gem_tasks" require 'rspec/core/rake_task' require 'fileutils' require 'rototiller' From cba04b5076b5ec62a0e99d98bf1eb1c5c8470f1e Mon Sep 17 00:00:00 2001 From: Eric Thompson Date: Mon, 3 Apr 2017 16:36:43 -0700 Subject: [PATCH 02/12] (maint) fix acceptance install for non-whole rake version strings * previous change did not account for when x.y.z rake version strings were not specified. --- acceptance/pre-suite/01_install_rototiller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/acceptance/pre-suite/01_install_rototiller.rb b/acceptance/pre-suite/01_install_rototiller.rb index 866b384..ec15058 100644 --- a/acceptance/pre-suite/01_install_rototiller.rb +++ b/acceptance/pre-suite/01_install_rototiller.rb @@ -8,8 +8,9 @@ end scp_to(sut, gem_name, gem_name) + rake_version = `rake --version`.split[2] if ENV['RAKE_VER'] - on(sut, "gem install rake --no-document --version #{ENV['RAKE_VER']}") + on(sut, "gem install rake --no-document --version #{rake_version}") else on(sut, "gem install --no-document rake") end From f947535f89945d3972b0489b8ac9a384b99eccb8 Mon Sep 17 00:00:00 2001 From: Eric Thompson Date: Mon, 3 Apr 2017 16:37:31 -0700 Subject: [PATCH 03/12] (maint) fix previous acceptance bundler on-sut removal * a previous commit removed the bundle on the SUT * forgot to commit the changes to the test to not specify bundle exec --- acceptance/lib/test_utilities.rb | 2 +- .../tests/rototillerTask/define_and_list_RototillerTasks.rb | 2 +- acceptance/tests/rototillerTask/environment_variables.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/acceptance/lib/test_utilities.rb b/acceptance/lib/test_utilities.rb index 5447836..4a8c026 100644 --- a/acceptance/lib/test_utilities.rb +++ b/acceptance/lib/test_utilities.rb @@ -33,7 +33,7 @@ def execute_task_on(host, task_name=nil, rakefile_path=nil, opts={}) step "Execute task '#{task_name}', ensure success" end - command = "bundle exec rake #{task_name}" + command = "rake #{task_name}" command = command + " --verbose" if opts[:verbose] command = command + " --rakefile #{rakefile_path}" if rakefile_path on(host, command, :accept_all_exit_codes => true) do |result| diff --git a/acceptance/tests/rototillerTask/define_and_list_RototillerTasks.rb b/acceptance/tests/rototillerTask/define_and_list_RototillerTasks.rb index e022c4f..9c7d601 100644 --- a/acceptance/tests/rototillerTask/define_and_list_RototillerTasks.rb +++ b/acceptance/tests/rototillerTask/define_and_list_RototillerTasks.rb @@ -43,7 +43,7 @@ def create_rakefile_task_segment(options) tasks.each do |task| step "Use the -T rake switch to test task '#{task[:task_name]}' description" do - on(sut, "bundle exec rake -T --rakefile #{rakefile_path}", :accept_all_exit_codes => true) do |result| + on(sut, "rake -T --rakefile #{rakefile_path}", :accept_all_exit_codes => true) do |result| assert(result.exit_code == 0, 'The expected exit code 0 was not observed') assert_no_match(/error/i, result.output, 'An unexpected error was observed') if task[:description] diff --git a/acceptance/tests/rototillerTask/environment_variables.rb b/acceptance/tests/rototillerTask/environment_variables.rb index 86a6868..5d0bc8e 100644 --- a/acceptance/tests/rototillerTask/environment_variables.rb +++ b/acceptance/tests/rototillerTask/environment_variables.rb @@ -69,7 +69,7 @@ rakefile_path = create_rakefile_on(sut, rakefile_contents) step 'Execute task defined in rake task' do - on(sut, "bundle exec rake #{@task_name} --rakefile #{rakefile_path}", :accept_all_exit_codes => true) do |result| + on(sut, "rake #{@task_name} --rakefile #{rakefile_path}", :accept_all_exit_codes => true) do |result| # exit code & no error in output assert(result.exit_code == 1, 'The expected exit code 1 was not observed') From 6204cccb461c049b1cb85139daacc80a4a67baad Mon Sep 17 00:00:00 2001 From: Eric Thompson Date: Tue, 4 Apr 2017 13:27:41 -0700 Subject: [PATCH 04/12] (maint) require < rake 12; we have a bug there --- rototiller.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rototiller.gemspec b/rototiller.gemspec index 0dcb9b6..c1e7257 100644 --- a/rototiller.gemspec +++ b/rototiller.gemspec @@ -17,5 +17,5 @@ Gem::Specification.new do |s| # RAKE_VER=0.9, 10.0, 11.0 # don't use 11.0.0, which probably installs 11.0.1 which has issues - s.add_runtime_dependency 'rake' + s.add_runtime_dependency 'rake', '< 12.0.0' end From a65a3d93e98cbe7df3af4ecd3ea519c5610f7db0 Mon Sep 17 00:00:00 2001 From: Eric Thompson Date: Tue, 4 Apr 2017 13:28:03 -0700 Subject: [PATCH 05/12] (maint) fix acceptance bundle * we can't commit a Gemfile.lock as we sweep one of our deps (rake) * unit test job uses bundle install not bundle update * pin some deps here. next major we'll require ruby > 2 --- .gitignore | 2 -- Gemfile | 36 ++++++++++++++++++++++++------------ Rakefile | 6 ++++-- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index ed11fef..a1ba0aa 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,6 @@ build/ # for a library or gem, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock # .ruby-version # .ruby-gemset @@ -49,7 +48,6 @@ spec/fixtures keys hieradata/*.eyaml -Gemfile.lock Gemfile.local /graphs diff --git a/Gemfile b/Gemfile index b963c80..42d5165 100644 --- a/Gemfile +++ b/Gemfile @@ -12,20 +12,40 @@ def location_for(place, fake_version = nil) end end +# unit tests: --without system_tests development # in the Rakefile, so we require it in all groups -rake_version = '>= 0.9.0' +# this must match the default in the Rakefile, if not specified +rake_version = '~> 11.0' if ENV['RAKE_VER'] rake_version = "~> #{ENV['RAKE_VER']}" end + gem 'rake' , "#{rake_version}" gem "rototiller", *location_for(ENV['TILLER_VERSION'] || '~> 0.1.0') gem 'rspec' ,'~> 3.4.0' group :system_tests do - gem 'beaker' ,'~> 3.0' + beaker_version = '~> 3.0' + nokogiri_version = '~> 1' # any + public_suffix_version = '~> 1' # any + activesupport_version = '~> 1' # any + # restrict gems to enable ruby versions + # + # nokogiri comes along for the ride but needs some restriction too + if Gem::Version.new(RUBY_VERSION).between?(Gem::Version.new('2.0.0'),Gem::Version.new('2.2.4')) + beaker_version = '< 3.9.0' + nokogiri_version = '< 1.7.0' + elsif Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0') + beaker_version = '~> 2.0' + nokogiri_version = '~> 1' # any + public_suffix_version = '< 1.5.0' + activesupport_version = '< 5.0.0' + end + gem 'beaker' ,"#{beaker_version}" gem 'beaker-hostgenerator' - gem 'public_suffix' ,'<= 1.4.6' - gem 'nokogiri' ,'<= 1.6.9' + gem 'nokogiri' ,"#{nokogiri_version}" + gem 'public_suffix' ,"#{public_suffix_version}" + gem 'activesupport' ,"#{activesupport_version}" end group :development do @@ -33,14 +53,6 @@ group :development do #Documentation dependencies gem 'yard' ,'~> 0' gem 'markdown' ,'~> 0' - # restrict version to enable ruby 1.9.3 - gem 'mime-types' ,'~> 2.0' - gem 'google-api-client' ,'<= 0.9.4' - gem 'activesupport' ,'< 5.0.0' - # restrict version to enable ruby 1.9.3 <-> 2.0.0 - if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0') - gem 'public_suffix' ,'<= 1.4.6' - end end local_gemfile = "#{__FILE__}.local" diff --git a/Rakefile b/Rakefile index 46f3a2d..0e6c87a 100644 --- a/Rakefile +++ b/Rakefile @@ -22,11 +22,13 @@ task :generate_host_config do |t, args| sh "cat acceptance/hosts.cfg" end +default_rake_ver = '11.0' + rototiller_task :acceptance => [:generate_host_config] do |t| t.add_env({:name => 'LAYOUT', :default => 'centos7-64', :message => 'The argument to pass to beaker-hostgenerator', :set_env => true}) - t.add_env({:name => 'RAKE_VER', :default => '12.0', + t.add_env({:name => 'RAKE_VER', :default => default_rake_ver, :message => 'The rake version to use when running unit and acceptance tests', :set_env => true}) @@ -72,7 +74,7 @@ end rototiller_task :check_test do |t| t.add_env({:name => 'SPEC_PATTERN', :default => 'spec/', :message => 'The pattern RSpec will use to find tests', :set_env => true}) - t.add_env({:name => 'RAKE_VER', :default => '11.0', :message => 'The rake version to use when running unit tests', :set_env => true}) + t.add_env({:name => 'RAKE_VER', :default => default_rake_ver, :message => 'The rake version to use when running unit tests', :set_env => true}) end task :yard => [:'docs:gen'] From a8dc77e4411191338fd6da73e45060b6e8916e71 Mon Sep 17 00:00:00 2001 From: Eric Thompson Date: Tue, 4 Apr 2017 14:34:19 -0700 Subject: [PATCH 06/12] (maint) fix acceptance bundle nokogiri ruby < 2 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 42d5165..5fe6226 100644 --- a/Gemfile +++ b/Gemfile @@ -37,7 +37,7 @@ group :system_tests do nokogiri_version = '< 1.7.0' elsif Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0') beaker_version = '~> 2.0' - nokogiri_version = '~> 1' # any + nokogiri_version = '< 1.7.0' public_suffix_version = '< 1.5.0' activesupport_version = '< 5.0.0' end From bb863adcac3ca29db7c429154cee0ae3086b75eb Mon Sep 17 00:00:00 2001 From: Eric Thompson Date: Tue, 4 Apr 2017 14:47:22 -0700 Subject: [PATCH 07/12] (maint) argh. some rubygem versions don't have --no-document --- acceptance/pre-suite/01_install_rototiller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/acceptance/pre-suite/01_install_rototiller.rb b/acceptance/pre-suite/01_install_rototiller.rb index ec15058..de18710 100644 --- a/acceptance/pre-suite/01_install_rototiller.rb +++ b/acceptance/pre-suite/01_install_rototiller.rb @@ -10,9 +10,9 @@ rake_version = `rake --version`.split[2] if ENV['RAKE_VER'] - on(sut, "gem install rake --no-document --version #{rake_version}") + on(sut, "gem install rake --version #{rake_version}") else - on(sut, "gem install --no-document rake") + on(sut, "gem install rake") end - on(sut, "gem install --no-document ./#{gem_name}") + on(sut, "gem install ./#{gem_name}") end From 829c32a3b3dcefc9b54d847acd9820dee45854c0 Mon Sep 17 00:00:00 2001 From: Eric Thompson Date: Tue, 4 Apr 2017 14:53:20 -0700 Subject: [PATCH 08/12] (maint) acceptance: force rake gem install over system rake --- acceptance/pre-suite/01_install_rototiller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acceptance/pre-suite/01_install_rototiller.rb b/acceptance/pre-suite/01_install_rototiller.rb index de18710..273d073 100644 --- a/acceptance/pre-suite/01_install_rototiller.rb +++ b/acceptance/pre-suite/01_install_rototiller.rb @@ -10,9 +10,9 @@ rake_version = `rake --version`.split[2] if ENV['RAKE_VER'] - on(sut, "gem install rake --version #{rake_version}") + on(sut, "gem install rake --force --version #{rake_version}") else - on(sut, "gem install rake") + on(sut, "gem install rake --force") end on(sut, "gem install ./#{gem_name}") end From 15fe25738e4a88d39a3b740b4765bcaf7faa2c15 Mon Sep 17 00:00:00 2001 From: Eric Thompson Date: Tue, 4 Apr 2017 16:47:20 -0700 Subject: [PATCH 09/12] (maint) rake version in Gemfile should not matter --- Gemfile | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 5fe6226..05bd8a8 100644 --- a/Gemfile +++ b/Gemfile @@ -13,14 +13,7 @@ def location_for(place, fake_version = nil) end # unit tests: --without system_tests development -# in the Rakefile, so we require it in all groups -# this must match the default in the Rakefile, if not specified -rake_version = '~> 11.0' -if ENV['RAKE_VER'] - rake_version = "~> #{ENV['RAKE_VER']}" -end - -gem 'rake' , "#{rake_version}" +gem 'rake' gem "rototiller", *location_for(ENV['TILLER_VERSION'] || '~> 0.1.0') gem 'rspec' ,'~> 3.4.0' From 4a7b57496e302221926751e7958997c3a340c423 Mon Sep 17 00:00:00 2001 From: Eric Thompson Date: Tue, 4 Apr 2017 16:47:51 -0700 Subject: [PATCH 10/12] (maint) acceptance: install implied rake version on sut --- acceptance/pre-suite/01_install_rototiller.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/acceptance/pre-suite/01_install_rototiller.rb b/acceptance/pre-suite/01_install_rototiller.rb index 273d073..36dfcd1 100644 --- a/acceptance/pre-suite/01_install_rototiller.rb +++ b/acceptance/pre-suite/01_install_rototiller.rb @@ -8,11 +8,12 @@ end scp_to(sut, gem_name, gem_name) - rake_version = `rake --version`.split[2] if ENV['RAKE_VER'] - on(sut, "gem install rake --force --version #{rake_version}") + rake_version = Gem::Version.new(ENV['RAKE_VER']).approximate_recommendation + on(sut, "gem install rake --version '#{rake_version}'") else - on(sut, "gem install rake --force") + on(sut, "gem install rake") end + on(sut, "gem install ./#{gem_name}") end From 73a1bed88f0396223f420c0f117036a4df68a118 Mon Sep 17 00:00:00 2001 From: Eric Thompson Date: Tue, 4 Apr 2017 17:19:31 -0700 Subject: [PATCH 11/12] (maint) who knew gem install could be so complicated? * force installs of rake to overwrite exes in osx --- acceptance/pre-suite/01_install_rototiller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acceptance/pre-suite/01_install_rototiller.rb b/acceptance/pre-suite/01_install_rototiller.rb index 36dfcd1..2787520 100644 --- a/acceptance/pre-suite/01_install_rototiller.rb +++ b/acceptance/pre-suite/01_install_rototiller.rb @@ -10,9 +10,9 @@ if ENV['RAKE_VER'] rake_version = Gem::Version.new(ENV['RAKE_VER']).approximate_recommendation - on(sut, "gem install rake --version '#{rake_version}'") + on(sut, "gem install rake --force --version '#{rake_version}'") else - on(sut, "gem install rake") + on(sut, "gem install rake --force") end on(sut, "gem install ./#{gem_name}") From 974dc6c3745dfb74172f24031c44e3ee06503ba5 Mon Sep 17 00:00:00 2001 From: Eric Thompson Date: Wed, 5 Apr 2017 09:35:00 -0700 Subject: [PATCH 12/12] (maint) re-add Gemfile.lock to .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index a1ba0aa..ed11fef 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ build/ # for a library or gem, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: +# Gemfile.lock # .ruby-version # .ruby-gemset @@ -48,6 +49,7 @@ spec/fixtures keys hieradata/*.eyaml +Gemfile.lock Gemfile.local /graphs