From 35afa2e29e34e0cae1500ba283da6d0d97b24a3d Mon Sep 17 00:00:00 2001 From: Florent Monbillard Date: Tue, 26 Feb 2019 16:49:59 -0500 Subject: [PATCH] Drop support for EOL rubies and simplify test matrix (#503) * Drop Ruby 2.2, add Ruby 2.6 * Drop Mongoid < 6 * Add Mongoid 6 and 7 in test matrix * Allow mongoid tests to fail for now * Simplify the test matrix --- .travis.yml | 76 ++++++------------- Appraisals | 14 ++-- gemfiles/Gemfile.rails-4.0 | 33 -------- gemfiles/Gemfile.rails-4.1 | 33 -------- gemfiles/Gemfile.rails-4.2 | 33 -------- gemfiles/activerecord_4.gemfile | 4 +- gemfiles/activerecord_5.gemfile | 2 +- .../{mongoid_5.gemfile => mongoid_6.gemfile} | 2 +- .../{mongoid_4.gemfile => mongoid_7.gemfile} | 2 +- rolify.gemspec | 8 +- spec/support/adapters/mongoid_4.yml | 6 -- .../adapters/{mongoid_5.yml => mongoid_6.yml} | 0 .../adapters/{mongoid_3.yml => mongoid_7.yml} | 4 +- 13 files changed, 43 insertions(+), 174 deletions(-) delete mode 100644 gemfiles/Gemfile.rails-4.0 delete mode 100644 gemfiles/Gemfile.rails-4.1 delete mode 100644 gemfiles/Gemfile.rails-4.2 rename gemfiles/{mongoid_5.gemfile => mongoid_6.gemfile} (94%) rename gemfiles/{mongoid_4.gemfile => mongoid_7.gemfile} (94%) delete mode 100644 spec/support/adapters/mongoid_4.yml rename spec/support/adapters/{mongoid_5.yml => mongoid_6.yml} (100%) rename spec/support/adapters/{mongoid_3.yml => mongoid_7.yml} (61%) diff --git a/.travis.yml b/.travis.yml index 37b7b02a..06ee975d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,60 +11,34 @@ script: bundle exec rake after_success: - bundle exec codeclimate-test-reporter -matrix: - include: - - rvm: 2.5.1 - gemfile: gemfiles/activerecord_4.gemfile - env: ADAPTER=active_record - - rvm: 2.4.4 - gemfile: gemfiles/activerecord_4.gemfile - env: ADAPTER=active_record - - rvm: 2.3.7 - gemfile: gemfiles/activerecord_4.gemfile - env: ADAPTER=active_record - - rvm: 2.2.10 - gemfile: gemfiles/activerecord_4.gemfile - env: ADAPTER=active_record +rvm: + - 2.6.1 + - 2.5.3 + - 2.4.5 + - 2.3.8 + +gemfile: + - gemfiles/activerecord_4.gemfile + - gemfiles/activerecord_5.gemfile + - gemfiles/mongoid_6.gemfile + - gemfiles/mongoid_7.gemfile + +env: + - ADAPTER=active_record + - ADAPTER=mongoid - - rvm: 2.5.1 - gemfile: gemfiles/activerecord_5.gemfile - env: ADAPTER=active_record - - rvm: 2.4.4 - gemfile: gemfiles/activerecord_5.gemfile - env: ADAPTER=active_record - - rvm: 2.3.7 - gemfile: gemfiles/activerecord_5.gemfile - env: ADAPTER=active_record - - rvm: 2.2.10 - gemfile: gemfiles/activerecord_5.gemfile - env: ADAPTER=active_record - - - rvm: 2.5.1 - gemfile: gemfiles/mongoid_4.gemfile - env: ADAPTER=mongoid - - rvm: 2.4.4 - gemfile: gemfiles/mongoid_4.gemfile - env: ADAPTER=mongoid - - rvm: 2.3.7 - gemfile: gemfiles/mongoid_4.gemfile - env: ADAPTER=mongoid - - rvm: 2.2.10 - gemfile: gemfiles/mongoid_4.gemfile - env: ADAPTER=mongoid - - - rvm: 2.5.1 - gemfile: gemfiles/mongoid_5.gemfile - env: ADAPTER=mongoid - - rvm: 2.4.4 - gemfile: gemfiles/mongoid_5.gemfile - env: ADAPTER=mongoid - - rvm: 2.3.7 - gemfile: gemfiles/mongoid_5.gemfile +matrix: + exclude: + - gemfile: gemfiles/activerecord_4.gemfile env: ADAPTER=mongoid - - rvm: 2.2.10 - gemfile: gemfiles/mongoid_5.gemfile + - gemfile: gemfiles/activerecord_5.gemfile env: ADAPTER=mongoid - + - gemfile: gemfiles/mongoid_6.gemfile + env: ADAPTER=active_record + - gemfile: gemfiles/mongoid_7.gemfile + env: ADAPTER=active_record + allow_failures: + - env: ADAPTER=mongoid services: mongodb diff --git a/Appraisals b/Appraisals index d57f9ae8..00dfd7cc 100644 --- a/Appraisals +++ b/Appraisals @@ -1,20 +1,20 @@ -appraise 'mongoid-4' do - gem "mongoid", "~> 4" +appraise 'mongoid-6' do + gem "mongoid", "~> 6" gem "bson_ext", :platform => "ruby" end -appraise 'mongoid-5' do - gem "mongoid", "~> 5" +appraise 'mongoid-7' do + gem "mongoid", "~> 7" gem "bson_ext", :platform => "ruby" end appraise 'activerecord-4' do - gem "sqlite3", :platform => "ruby" - gem "activerecord", "~> 4.2.5", :require => "active_record" + gem "sqlite3", "~> 1.3.6", :platform => "ruby" + gem "activerecord", "~> 4.2.11", :require => "active_record" end appraise 'activerecord-5' do - gem "sqlite3", :platform => "ruby" + gem "sqlite3", "~> 1.3.6", :platform => "ruby" gem "activerecord", ">= 5.2.0", :require => "active_record" # Ammeter dependencies: diff --git a/gemfiles/Gemfile.rails-4.0 b/gemfiles/Gemfile.rails-4.0 deleted file mode 100644 index 06744c1a..00000000 --- a/gemfiles/Gemfile.rails-4.0 +++ /dev/null @@ -1,33 +0,0 @@ -source 'https://rubygems.org' - -platforms :rbx do - gem 'psych' - gem 'rubinius-coverage', '~> 2.0' -end - -group :test do - gem 'railties', '~> 4.0.13' - gem 'ammeter' - gem 'rake' - gem 'rspec' - gem 'its' - gem 'rspec-rails' - gem 'fuubar' - gem 'bundler' - - gem 'coveralls', :require => false - - case ENV['ADAPTER'] - when nil, 'active_record' - gem 'activerecord', '~> 4.0.13', :require => 'active_record' - gem 'activerecord-jdbcsqlite3-adapter', '~> 1.3.5', :platform => 'jruby' - #Fix sqlite3 version for rbx until rubinus is updated - #https://github.com/travis-ci/travis-ci/issues/2006 - gem 'sqlite3', '1.3.8', :platform => 'ruby' - when 'mongoid' - gem 'mongoid', github: 'mongoid/mongoid' - gem 'bson_ext', :platform => 'ruby' - else - raise "Unknown model adapter: #{ENV['ADAPTER']}" - end -end diff --git a/gemfiles/Gemfile.rails-4.1 b/gemfiles/Gemfile.rails-4.1 deleted file mode 100644 index 6434d6d8..00000000 --- a/gemfiles/Gemfile.rails-4.1 +++ /dev/null @@ -1,33 +0,0 @@ -source 'https://rubygems.org' - -platforms :rbx do - gem 'psych' - gem 'rubinius-coverage', '~> 2.0' -end - -group :test do - gem 'railties', '~> 4.1.16' - gem 'ammeter' - gem 'rake' - gem 'rspec' - gem 'its' - gem 'rspec-rails' - gem 'fuubar' - gem 'bundler' - - gem 'coveralls', :require => false - - case ENV['ADAPTER'] - when nil, 'active_record' - gem 'activerecord', '~> 4.1.16', :require => 'active_record' - gem 'activerecord-jdbcsqlite3-adapter', '~> 1.3.5', :platform => 'jruby' - #Fix sqlite3 version for rbx until rubinus is updated - #https://github.com/travis-ci/travis-ci/issues/2006 - gem 'sqlite3', '1.3.8', :platform => 'ruby' - when 'mongoid' - gem 'mongoid', github: 'mongoid/mongoid' - gem 'bson_ext', :platform => 'ruby' - else - raise "Unknown model adapter: #{ENV['ADAPTER']}" - end -end diff --git a/gemfiles/Gemfile.rails-4.2 b/gemfiles/Gemfile.rails-4.2 deleted file mode 100644 index d35b3a2e..00000000 --- a/gemfiles/Gemfile.rails-4.2 +++ /dev/null @@ -1,33 +0,0 @@ -source 'https://rubygems.org' - -platforms :rbx do - gem 'psych' - gem 'rubinius-coverage', '~> 2.0' -end - -group :test do - gem 'railties', '~> 4.2.9' - gem 'ammeter' - gem 'rake' - gem 'rspec' - gem 'its' - gem 'rspec-rails' - gem 'fuubar' - gem 'bundler' - - gem 'coveralls', :require => false - - case ENV['ADAPTER'] - when nil, 'active_record' - gem 'activerecord', '~> 4.2.9', :require => 'active_record' - gem 'activerecord-jdbcsqlite3-adapter', '~> 1.3.5', :platform => 'jruby' - #Fix sqlite3 version for rbx until rubinus is updated - #https://github.com/travis-ci/travis-ci/issues/2006 - gem 'sqlite3', '1.3.8', :platform => 'ruby' - when 'mongoid' - gem 'mongoid', github: 'mongoid/mongoid' - gem 'bson_ext', :platform => 'ruby' - else - raise "Unknown model adapter: #{ENV['ADAPTER']}" - end -end diff --git a/gemfiles/activerecord_4.gemfile b/gemfiles/activerecord_4.gemfile index 8624e972..ac482f9d 100644 --- a/gemfiles/activerecord_4.gemfile +++ b/gemfiles/activerecord_4.gemfile @@ -2,8 +2,8 @@ source "https://rubygems.org" -gem "sqlite3", platform: "ruby" -gem "activerecord", "~> 4.2.5", require: "active_record" +gem "sqlite3", "~> 1.3.6", platform: "ruby" +gem "activerecord", "~> 4.2.11", require: "active_record" group :test do gem "appraisal" diff --git a/gemfiles/activerecord_5.gemfile b/gemfiles/activerecord_5.gemfile index c1580353..a59b38f4 100644 --- a/gemfiles/activerecord_5.gemfile +++ b/gemfiles/activerecord_5.gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -gem "sqlite3", platform: "ruby" +gem "sqlite3", "~> 1.3.6", platform: "ruby" gem "activerecord", ">= 5.2.0", require: "active_record" gem "actionpack", ">= 5.2.0" gem "activemodel", ">= 5.2.0" diff --git a/gemfiles/mongoid_5.gemfile b/gemfiles/mongoid_6.gemfile similarity index 94% rename from gemfiles/mongoid_5.gemfile rename to gemfiles/mongoid_6.gemfile index d70b24f2..dddd76be 100644 --- a/gemfiles/mongoid_5.gemfile +++ b/gemfiles/mongoid_6.gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -gem "mongoid", "~> 5" +gem "mongoid", "~> 6" gem "bson_ext", platform: "ruby" group :test do diff --git a/gemfiles/mongoid_4.gemfile b/gemfiles/mongoid_7.gemfile similarity index 94% rename from gemfiles/mongoid_4.gemfile rename to gemfiles/mongoid_7.gemfile index f3706439..c0ab9d51 100644 --- a/gemfiles/mongoid_4.gemfile +++ b/gemfiles/mongoid_7.gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -gem "mongoid", "~> 4" +gem "mongoid", "~> 7" gem "bson_ext", platform: "ruby" group :test do diff --git a/rolify.gemspec b/rolify.gemspec index 035b5154..9fe6d2ab 100644 --- a/rolify.gemspec +++ b/rolify.gemspec @@ -27,10 +27,10 @@ Gem::Specification.new do |s| s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ['lib'] - s.required_ruby_version = '>= 2.2' + s.required_ruby_version = '>= 2.3' s.add_development_dependency 'ammeter', '~> 1.1' # Spec generator - s.add_development_dependency 'bundler', '~> 1.13' # packaging feature - s.add_development_dependency 'rake', '~> 11.3' # Tasks manager - s.add_development_dependency 'rspec-rails', '~> 3.4' + s.add_development_dependency 'bundler', '~> 2.0' # packaging feature + s.add_development_dependency 'rake', '~> 12.3' # Tasks manager + s.add_development_dependency 'rspec-rails', '~> 3.8' end diff --git a/spec/support/adapters/mongoid_4.yml b/spec/support/adapters/mongoid_4.yml deleted file mode 100644 index 9b94717a..00000000 --- a/spec/support/adapters/mongoid_4.yml +++ /dev/null @@ -1,6 +0,0 @@ -test: - sessions: - default: - database: godfather - hosts: - - localhost:27017 \ No newline at end of file diff --git a/spec/support/adapters/mongoid_5.yml b/spec/support/adapters/mongoid_6.yml similarity index 100% rename from spec/support/adapters/mongoid_5.yml rename to spec/support/adapters/mongoid_6.yml diff --git a/spec/support/adapters/mongoid_3.yml b/spec/support/adapters/mongoid_7.yml similarity index 61% rename from spec/support/adapters/mongoid_3.yml rename to spec/support/adapters/mongoid_7.yml index 9b94717a..96903ac7 100644 --- a/spec/support/adapters/mongoid_3.yml +++ b/spec/support/adapters/mongoid_7.yml @@ -1,6 +1,6 @@ test: - sessions: + clients: default: database: godfather hosts: - - localhost:27017 \ No newline at end of file + - localhost:27017