From 131d7791c539be3d54d724efff5987d212267be6 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Tue, 30 Mar 2021 02:18:27 +0200 Subject: [PATCH] Fix JRuby CI build (#1475) * Remove obsolete gemfile * Work around issue with the combination of I18n and JRuby See https://github.com/jruby/jruby/issues/6547 and https://github.com/ruby-i18n/i18n/issues/555 * Use correct released versions of activerecord-jdbcsqlite3-adapter * Require CI to pass on JRuby again * Build on latest JRuby 9.2 version --- .travis.yml | 3 +-- Appraisals | 6 +++--- gemfiles/6.0.gemfile | 2 +- gemfiles/6.1.gemfile | 2 +- gemfiles/main.gemfile | 2 +- gemfiles/master.gemfile | 9 --------- spec/spec_helper.rb | 8 ++++++++ 7 files changed, 15 insertions(+), 17 deletions(-) delete mode 100644 gemfiles/master.gemfile diff --git a/.travis.yml b/.travis.yml index 51c7c24..085b207 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ rvm: - 2.6 - 2.7 - 3.0 - - jruby-9.2.8.0 + - jruby-9.2.14.0 - ruby-head before_install: - gem update --system @@ -39,7 +39,6 @@ matrix: gemfile: gemfiles/5.2.gemfile allow_failures: - rvm: ruby-head - - rvm: jruby-9.2.8.0 - gemfile: gemfiles/main.gemfile branches: only: diff --git a/Appraisals b/Appraisals index 14958ba..64efee7 100644 --- a/Appraisals +++ b/Appraisals @@ -18,18 +18,18 @@ end appraise "6.0" do gem "activerecord", "~> 6.0.0" - gem "activerecord-jdbcsqlite3-adapter", "~> 60.0.rc1", platforms: [:jruby] + gem "activerecord-jdbcsqlite3-adapter", "~> 60.0", platforms: [:jruby] gem "sqlite3", platforms: [:ruby] end appraise "6.1" do gem "activerecord", "~> 6.1.0" - gem "activerecord-jdbcsqlite3-adapter", "~> 60.0.rc1", platforms: [:jruby] + gem "activerecord-jdbcsqlite3-adapter", "~> 61.0", platforms: [:jruby] gem "sqlite3", platforms: [:ruby] end appraise "main" do gem "activerecord", git: "https://github.com/rails/rails.git", branch: "main" - gem "activerecord-jdbcsqlite3-adapter", "~> 60.0", platforms: [:jruby] + gem "activerecord-jdbcsqlite3-adapter", "~> 61.0", platforms: [:jruby] gem "sqlite3", platforms: [:ruby] end diff --git a/gemfiles/6.0.gemfile b/gemfiles/6.0.gemfile index 85c4a9d..15c38e1 100644 --- a/gemfiles/6.0.gemfile +++ b/gemfiles/6.0.gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -gem "activerecord-jdbcsqlite3-adapter", "~> 60.0.rc1", platforms: [:jruby] +gem "activerecord-jdbcsqlite3-adapter", "~> 60.0", platforms: [:jruby] gem "sqlite3", platforms: [:ruby] gem "activerecord", "~> 6.0.0" diff --git a/gemfiles/6.1.gemfile b/gemfiles/6.1.gemfile index b4c545e..6deb0e3 100644 --- a/gemfiles/6.1.gemfile +++ b/gemfiles/6.1.gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -gem "activerecord-jdbcsqlite3-adapter", "~> 60.0.rc1", platforms: [:jruby] +gem "activerecord-jdbcsqlite3-adapter", "~> 61.0", platforms: [:jruby] gem "sqlite3", platforms: [:ruby] gem "activerecord", "~> 6.1.0" diff --git a/gemfiles/main.gemfile b/gemfiles/main.gemfile index 8ba9749..1d23fd6 100644 --- a/gemfiles/main.gemfile +++ b/gemfiles/main.gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -gem "activerecord-jdbcsqlite3-adapter", "~> 60.0", platforms: [:jruby] +gem "activerecord-jdbcsqlite3-adapter", "~> 61.0", platforms: [:jruby] gem "sqlite3", platforms: [:ruby] gem "activerecord", git: "https://github.com/rails/rails.git", branch: "main" diff --git a/gemfiles/master.gemfile b/gemfiles/master.gemfile deleted file mode 100644 index 68f6096..0000000 --- a/gemfiles/master.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord-jdbcsqlite3-adapter", "~> 60.0", platforms: [:jruby] -gem "sqlite3", platforms: [:ruby] -gem "activerecord", git: "git@github.com:rails/rails.git" - -gemspec name: "factory_bot", path: "../" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c02df0e..c97be81 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,6 +5,14 @@ require "simplecov" require "factory_bot" +if RUBY_ENGINE == "jruby" + # Workaround for issue in I18n/JRuby combo. + # See https://github.com/jruby/jruby/issues/6547 and + # https://github.com/ruby-i18n/i18n/issues/555 + require "i18n/backend" + require "i18n/backend/simple" +end + Dir["spec/support/**/*.rb"].each { |f| require File.expand_path(f) } RSpec.configure do |config|