From 56131930e6d787cf534afcfcbc721e12af2c71bb Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev <39304720+p-mongo@users.noreply.github.com> Date: Mon, 22 Feb 2021 23:36:25 -0500 Subject: [PATCH] MONGOID-5051 Fix JRuby test failures on master (#4957) * .dockerignore copied from driver * ignore tmp * restrict to i18n < 1.8.8 * dry gemfiles * Always install tzdata Co-authored-by: Oleg Pudeyev --- .dockerignore | 6 ++++ Gemfile | 37 +++++++------------------ gemfiles/driver_master.gemfile | 30 ++------------------ gemfiles/driver_master_jruby.gemfile | 33 ++++------------------ gemfiles/driver_min.gemfile | 30 ++------------------ gemfiles/driver_min_jruby.gemfile | 29 ++++--------------- gemfiles/driver_oldstable.gemfile | 30 ++------------------ gemfiles/driver_oldstable_jruby.gemfile | 29 ++++--------------- gemfiles/driver_stable.gemfile | 34 ++--------------------- gemfiles/driver_stable_jruby.gemfile | 29 ++++--------------- gemfiles/i18n-1.0.gemfile | 30 ++------------------ gemfiles/rails_51.gemfile | 30 ++------------------ gemfiles/rails_52.gemfile | 30 ++------------------ gemfiles/rails_60.gemfile | 30 ++------------------ gemfiles/rails_master.gemfile | 30 ++------------------ gemfiles/standard.rb | 34 +++++++++++++++++++++++ spec/shared | 2 +- 17 files changed, 98 insertions(+), 375 deletions(-) create mode 100644 .dockerignore create mode 100644 gemfiles/standard.rb diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..3cfff60a9e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +/.git +/yard-docs +Gemfile.lock +gemfiles/*.lock +.env.private* +/tmp diff --git a/Gemfile b/Gemfile index 5d5cb35fd3..6891784112 100644 --- a/Gemfile +++ b/Gemfile @@ -1,35 +1,18 @@ source 'https://rubygems.org' + gemspec -gem 'rake' -gem 'actionpack' -gem 'activemodel' +require_relative './gemfiles/standard' -gem 'i18n', '~> 1.0', '>= 1.1' +standard_dependencies -group :development do - gem 'yard' -end +gem 'actionpack' +gem 'activemodel' -group :development, :test do - gem 'rspec-core', '~> 3.7' - - platform :jruby do - gem 'ruby-debug' - end +i18n_versions = ['~> 1.0', '>= 1.1'] +if RUBY_PLATFORM =~ /java/ + # https://github.com/jruby/jruby/issues/6573 + i18n_versions << '< 1.8.8' end -group :test do - gem 'timecop' - gem 'rspec-retry' - gem 'benchmark-ips' - gem 'rspec-expectations', '~> 3.7', '>= 3.8.4' - gem 'rspec-mocks-diag', '~> 3.0' - gem 'fuubar' - gem 'rfc' - gem 'childprocess' - platforms :mri do - gem 'timeout-interrupt' - gem 'byebug' - end -end +gem 'i18n', *i18n_versions diff --git a/gemfiles/driver_master.gemfile b/gemfiles/driver_master.gemfile index 36604c2d73..505547434e 100644 --- a/gemfiles/driver_master.gemfile +++ b/gemfiles/driver_master.gemfile @@ -3,37 +3,13 @@ source "https://rubygems.org" gem 'bson', git: "https://github.com/mongodb/bson-ruby" gem 'mongo', git: "https://github.com/mongodb/mongo-ruby-driver" -gem 'rake' gem 'actionpack', '~> 5.1' gem 'activemodel', '~> 5.1' gem 'i18n', '~> 1.0' -group :development do - gem 'yard' -end - -group :development, :test do - gem 'rspec-core', '~> 3.7' - - platform :jruby do - gem 'ruby-debug' - end -end +gemspec path: '..' -group :test do - gem 'timecop' - gem 'rspec-retry' - gem 'benchmark-ips' - gem 'rspec-expectations', '~> 3.7', '>= 3.8.4' - gem 'rspec-mocks-diag', '~> 3.0' - gem 'fuubar' - gem 'rfc' - gem 'childprocess' - platforms :mri do - gem 'timeout-interrupt' - gem 'byebug' - end -end +require_relative './standard' -gemspec path: '..' +standard_dependencies diff --git a/gemfiles/driver_master_jruby.gemfile b/gemfiles/driver_master_jruby.gemfile index 5d7335e7e2..0ed0c338dd 100644 --- a/gemfiles/driver_master_jruby.gemfile +++ b/gemfiles/driver_master_jruby.gemfile @@ -7,37 +7,14 @@ source "https://rubygems.org" # This gemfile only specifies driver git source. gem 'mongo', git: "https://github.com/mongodb/mongo-ruby-driver" -gem 'rake' gem 'actionpack', '~> 5.1' gem 'activemodel', '~> 5.1' -gem 'i18n', '~> 1.0' +# https://github.com/jruby/jruby/issues/6573 +gem 'i18n', '~> 1.0', '< 1.8.8' -group :development do - gem 'yard' -end - -group :development, :test do - gem 'rspec-core', '~> 3.7' - - platform :jruby do - gem 'ruby-debug' - end -end +gemspec path: '..' -group :test do - gem 'timecop' - gem 'rspec-retry' - gem 'benchmark-ips' - gem 'rspec-expectations', '~> 3.7', '>= 3.8.4' - gem 'rspec-mocks-diag', '~> 3.0' - gem 'fuubar' - gem 'rfc' - gem 'childprocess' - platforms :mri do - gem 'timeout-interrupt' - gem 'byebug' - end -end +require_relative './standard' -gemspec path: '..' +standard_dependencies diff --git a/gemfiles/driver_min.gemfile b/gemfiles/driver_min.gemfile index 83ab2e6ed0..c5d0087a80 100644 --- a/gemfiles/driver_min.gemfile +++ b/gemfiles/driver_min.gemfile @@ -2,37 +2,13 @@ source "https://rubygems.org" gem 'mongo', git: "https://github.com/mongodb/mongo-ruby-driver", branch: '2.10-stable' -gem 'rake' gem 'actionpack', '~> 5.1' gem 'activemodel', '~> 5.1' gem 'i18n', '~> 1.0' -group :development do - gem 'yard' -end - -group :development, :test do - gem 'rspec-core', '~> 3.7' - - platform :jruby do - gem 'ruby-debug' - end -end +gemspec path: '..' -group :test do - gem 'timecop' - gem 'rspec-retry' - gem 'benchmark-ips' - gem 'rspec-expectations', '~> 3.7', '>= 3.8.4' - gem 'rspec-mocks-diag', '~> 3.0' - gem 'fuubar' - gem 'rfc' - gem 'childprocess' - platforms :mri do - gem 'timeout-interrupt' - gem 'byebug' - end -end +require_relative './standard' -gemspec path: '..' +standard_dependencies diff --git a/gemfiles/driver_min_jruby.gemfile b/gemfiles/driver_min_jruby.gemfile index d48b92e8a0..554d4312af 100644 --- a/gemfiles/driver_min_jruby.gemfile +++ b/gemfiles/driver_min_jruby.gemfile @@ -5,33 +5,14 @@ source "https://rubygems.org" # bson with JRuby, just test the driver then gem 'mongo', git: "https://github.com/mongodb/mongo-ruby-driver", branch: '2.10-stable' -gem 'rake' gem 'actionpack', '~> 5.1' gem 'activemodel', '~> 5.1' -gem 'i18n', '~> 1.0' +# https://github.com/jruby/jruby/issues/6573 +gem 'i18n', '~> 1.0', '< 1.8.8' -group :development do - gem 'yard' -end - -group :development, :test do - gem 'rspec-core', '~> 3.7' - - platform :jruby do - gem 'ruby-debug' - end -end +gemspec path: '..' -group :test do - gem 'timecop' - gem 'rspec-retry' - gem 'benchmark-ips' - gem 'rspec-expectations', '~> 3.7', '>= 3.8.4' - gem 'rspec-mocks-diag', '~> 3.0' - gem 'fuubar' - gem 'rfc' - gem 'childprocess' -end +require_relative './standard' -gemspec path: '..' +standard_dependencies diff --git a/gemfiles/driver_oldstable.gemfile b/gemfiles/driver_oldstable.gemfile index 5ebbcccec7..1ca9dc4680 100644 --- a/gemfiles/driver_oldstable.gemfile +++ b/gemfiles/driver_oldstable.gemfile @@ -3,37 +3,13 @@ source "https://rubygems.org" gem 'bson', git: "https://github.com/mongodb/bson-ruby" gem 'mongo', git: "https://github.com/mongodb/mongo-ruby-driver", branch: '2.12-stable' -gem 'rake' gem 'actionpack', '~> 5.1' gem 'activemodel', '~> 5.1' gem 'i18n', '~> 1.0' -group :development do - gem 'yard' -end - -group :development, :test do - gem 'rspec-core', '~> 3.7' - - platform :jruby do - gem 'ruby-debug' - end -end +gemspec path: '..' -group :test do - gem 'timecop' - gem 'rspec-retry' - gem 'benchmark-ips' - gem 'rspec-expectations', '~> 3.7', '>= 3.8.4' - gem 'rspec-mocks-diag', '~> 3.0' - gem 'fuubar' - gem 'rfc' - gem 'childprocess' - platforms :mri do - gem 'timeout-interrupt' - gem 'byebug' - end -end +require_relative './standard' -gemspec path: '..' +standard_dependencies diff --git a/gemfiles/driver_oldstable_jruby.gemfile b/gemfiles/driver_oldstable_jruby.gemfile index 0cecc4575c..284a4d6a11 100644 --- a/gemfiles/driver_oldstable_jruby.gemfile +++ b/gemfiles/driver_oldstable_jruby.gemfile @@ -5,33 +5,14 @@ source "https://rubygems.org" # bson with JRuby, just test the driver then gem 'mongo', git: "https://github.com/mongodb/mongo-ruby-driver", branch: '2.12-stable' -gem 'rake' gem 'actionpack', '~> 5.1' gem 'activemodel', '~> 5.1' -gem 'i18n', '~> 1.0' +# https://github.com/jruby/jruby/issues/6573 +gem 'i18n', '~> 1.0', '< 1.8.8' -group :development do - gem 'yard' -end - -group :development, :test do - gem 'rspec-core', '~> 3.7' - - platform :jruby do - gem 'ruby-debug' - end -end +gemspec path: '..' -group :test do - gem 'timecop' - gem 'rspec-retry' - gem 'benchmark-ips' - gem 'rspec-expectations', '~> 3.7', '>= 3.8.4' - gem 'rspec-mocks-diag', '~> 3.0' - gem 'fuubar' - gem 'rfc' - gem 'childprocess' -end +require_relative './standard' -gemspec path: '..' +standard_dependencies diff --git a/gemfiles/driver_stable.gemfile b/gemfiles/driver_stable.gemfile index 4a7d6a4658..e19f571440 100644 --- a/gemfiles/driver_stable.gemfile +++ b/gemfiles/driver_stable.gemfile @@ -3,41 +3,13 @@ source "https://rubygems.org" gem 'bson', git: "https://github.com/mongodb/bson-ruby" gem 'mongo', git: "https://github.com/mongodb/mongo-ruby-driver", branch: '2.13-stable' -gem 'rake' gem 'actionpack', '~> 5.1' gem 'activemodel', '~> 5.1' gem 'i18n', '~> 1.0' -group :development do - gem 'yard' -end - -group :development, :test do - gem 'rspec-core', '~> 3.7' - - platform :jruby do - gem 'ruby-debug' - end -end +gemspec path: '..' -group :test do - gem 'timecop' - gem 'rspec-retry' - gem 'benchmark-ips' - gem 'rspec-expectations', '~> 3.7', '>= 3.8.4' - gem 'rspec-mocks-diag', '~> 3.0' - gem 'fuubar' - gem 'rfc' - gem 'childprocess' - platforms :mri do - gem 'timeout-interrupt' - if RUBY_VERSION <= '2.3' - gem 'byebug', '~> 10' - else - gem 'byebug' - end - end -end +require_relative './standard' -gemspec path: '..' +standard_dependencies diff --git a/gemfiles/driver_stable_jruby.gemfile b/gemfiles/driver_stable_jruby.gemfile index 7db48abe12..b2ef81e02a 100644 --- a/gemfiles/driver_stable_jruby.gemfile +++ b/gemfiles/driver_stable_jruby.gemfile @@ -5,33 +5,14 @@ source "https://rubygems.org" # bson with JRuby, just test the driver then gem 'mongo', git: "https://github.com/mongodb/mongo-ruby-driver", branch: '2.13-stable' -gem 'rake' gem 'actionpack', '~> 5.1' gem 'activemodel', '~> 5.1' -gem 'i18n', '~> 1.0' +# https://github.com/jruby/jruby/issues/6573 +gem 'i18n', '~> 1.0', '< 1.8.8' -group :development do - gem 'yard' -end - -group :development, :test do - gem 'rspec-core', '~> 3.7' - - platform :jruby do - gem 'ruby-debug' - end -end +gemspec path: '..' -group :test do - gem 'timecop' - gem 'rspec-retry' - gem 'benchmark-ips' - gem 'rspec-expectations', '~> 3.7', '>= 3.8.4' - gem 'rspec-mocks-diag', '~> 3.0' - gem 'fuubar' - gem 'rfc' - gem 'childprocess' -end +require_relative './standard' -gemspec path: '..' +standard_dependencies diff --git a/gemfiles/i18n-1.0.gemfile b/gemfiles/i18n-1.0.gemfile index 963f9dde31..6f4925c381 100644 --- a/gemfiles/i18n-1.0.gemfile +++ b/gemfiles/i18n-1.0.gemfile @@ -1,37 +1,13 @@ source "https://rubygems.org" -gem 'rake' gem 'actionpack', '~> 5.1' gem 'activemodel', '~> 5.1' # https://jira.mongodb.org/browse/MONGOID-4614 gem 'i18n', '~> 1.0.0' -group :development do - gem 'yard' -end - -group :development, :test do - gem 'rspec-core', '~> 3.7' - - platform :jruby do - gem 'ruby-debug' - end -end +gemspec path: '..' -group :test do - gem 'timecop' - gem 'rspec-retry' - gem 'benchmark-ips' - gem 'rspec-expectations', '~> 3.7', '>= 3.8.4' - gem 'rspec-mocks-diag', '~> 3.0' - gem 'fuubar' - gem 'rfc' - gem 'childprocess' - platforms :mri do - gem 'timeout-interrupt' - gem 'byebug' - end -end +require_relative './standard' -gemspec path: '..' +standard_dependencies diff --git a/gemfiles/rails_51.gemfile b/gemfiles/rails_51.gemfile index 54652747a7..664173979a 100644 --- a/gemfiles/rails_51.gemfile +++ b/gemfiles/rails_51.gemfile @@ -1,36 +1,12 @@ source 'https://rubygems.org' -gem 'rake' gem 'actionpack', '~> 5.1.0' gem 'activemodel', '~> 5.1.0' gem 'i18n', '~> 1.0' -group :development do - gem 'yard' -end - -group :development, :test do - gem 'rspec-core', '~> 3.7' - - platform :jruby do - gem 'ruby-debug' - end -end +gemspec path: '..' -group :test do - gem 'timecop' - gem 'rspec-retry' - gem 'benchmark-ips' - gem 'rspec-expectations', '~> 3.7', '>= 3.8.4' - gem 'rspec-mocks-diag', '~> 3.0' - gem 'fuubar' - gem 'rfc' - gem 'childprocess' - platforms :mri do - gem 'timeout-interrupt' - gem 'byebug' - end -end +require_relative './standard' -gemspec path: '..' +standard_dependencies diff --git a/gemfiles/rails_52.gemfile b/gemfiles/rails_52.gemfile index c35486bbd9..3e6fdde188 100644 --- a/gemfiles/rails_52.gemfile +++ b/gemfiles/rails_52.gemfile @@ -1,36 +1,12 @@ source 'https://rubygems.org' -gem 'rake' gem 'actionpack', '~> 5.2.0' gem 'activemodel', '~> 5.2.0' gem 'i18n', '~> 1.0' -group :development do - gem 'yard' -end - -group :development, :test do - gem 'rspec-core', '~> 3.7' - - platform :jruby do - gem 'ruby-debug' - end -end +gemspec path: '..' -group :test do - gem 'timecop' - gem 'rspec-retry' - gem 'benchmark-ips' - gem 'rspec-expectations', '~> 3.7', '>= 3.8.4' - gem 'rspec-mocks-diag', '~> 3.0' - gem 'fuubar' - gem 'rfc' - gem 'childprocess' - platforms :mri do - gem 'timeout-interrupt' - gem 'byebug' - end -end +require_relative './standard' -gemspec path: '..' +standard_dependencies diff --git a/gemfiles/rails_60.gemfile b/gemfiles/rails_60.gemfile index b1d662da1b..a46af37276 100644 --- a/gemfiles/rails_60.gemfile +++ b/gemfiles/rails_60.gemfile @@ -1,34 +1,10 @@ source 'https://rubygems.org' -gem 'rake' gem 'actionpack', '~> 6.0.0' gem 'activemodel', '~> 6.0.0' -group :development do - gem 'yard' -end - -group :development, :test do - gem 'rspec-core', '~> 3.7' - - platform :jruby do - gem 'ruby-debug' - end -end +gemspec path: '..' -group :test do - gem 'timecop' - gem 'rspec-retry' - gem 'benchmark-ips' - gem 'rspec-expectations', '~> 3.7', '>= 3.8.4' - gem 'rspec-mocks-diag', '~> 3.0' - gem 'fuubar' - gem 'rfc' - gem 'childprocess' - platforms :mri do - gem 'timeout-interrupt' - gem 'byebug' - end -end +require_relative './standard' -gemspec path: '..' +standard_dependencies diff --git a/gemfiles/rails_master.gemfile b/gemfiles/rails_master.gemfile index f2f733ee29..5a2d2fdfda 100644 --- a/gemfiles/rails_master.gemfile +++ b/gemfiles/rails_master.gemfile @@ -1,36 +1,12 @@ source 'https://rubygems.org' -gem 'rake' gem 'actionpack', git: 'https://github.com/rails/rails' gem 'activemodel', git: 'https://github.com/rails/rails' gem 'i18n', '~> 1.0' -group :development do - gem 'yard' -end - -group :development, :test do - gem 'rspec-core', '~> 3.7' - - platform :jruby do - gem 'ruby-debug' - end -end +gemspec path: '..' -group :test do - gem 'timecop' - gem 'rspec-retry' - gem 'benchmark-ips' - gem 'rspec-expectations', '~> 3.7', '>= 3.8.4' - gem 'rspec-mocks-diag', '~> 3.0' - gem 'fuubar' - gem 'rfc' - gem 'childprocess' - platforms :mri do - gem 'timeout-interrupt' - gem 'byebug' - end -end +require_relative './standard' -gemspec path: '..' +standard_dependencies diff --git a/gemfiles/standard.rb b/gemfiles/standard.rb new file mode 100644 index 0000000000..f56d45d7e5 --- /dev/null +++ b/gemfiles/standard.rb @@ -0,0 +1,34 @@ +def standard_dependencies + gem 'rake' + + group :development do + gem 'yard' + end + + group :development, :test do + gem 'rspec-core', '~> 3.7' + + platform :mri do + gem 'byebug' + end + + platform :jruby do + gem 'ruby-debug' + end + end + + group :test do + gem 'timecop' + gem 'rspec-retry' + gem 'benchmark-ips' + gem 'rspec-expectations', '~> 3.7', '>= 3.8.4' + gem 'rspec-mocks-diag', '~> 3.0' + gem 'fuubar' + gem 'rfc' + gem 'childprocess' + + platform :mri do + gem 'timeout-interrupt' + end + end +end diff --git a/spec/shared b/spec/shared index 1c6a421a1f..26b77d758e 160000 --- a/spec/shared +++ b/spec/shared @@ -1 +1 @@ -Subproject commit 1c6a421a1f9c9b689d4f39dd701032a2ec11c16f +Subproject commit 26b77d758e25170450ebf4e1593c050b4db5a233