Skip to content

Commit

Permalink
Add JRuby 9.4 to testing matrix; nerf ActiveJob::TestQueueAdapter ove…
Browse files Browse the repository at this point in the history
…rrides
  • Loading branch information
bensheldon committed Sep 4, 2023
1 parent d1cde17 commit 81af06c
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 28 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
timeout-minutes: 20
strategy:
matrix:
ruby: [2.6, 2.7, "3.0", 3.1, 3.2, jruby-9.3]
ruby: [2.6, 2.7, "3.0", 3.1, 3.2, jruby-9.3, jruby-9.4]
pg: [15]
include:
- ruby: 3.2
Expand All @@ -87,13 +87,13 @@ jobs:
pg: 13
- ruby: 3.2
pg: 14
- ruby: jruby-9.3
- ruby: jruby-9.4
pg: 11
- ruby: jruby-9.3
- ruby: jruby-9.4
pg: 12
- ruby: jruby-9.3
- ruby: jruby-9.4
pg: 13
- ruby: jruby-9.3
- ruby: jruby-9.4
pg: 14
env:
PGHOST: localhost
Expand Down
20 changes: 17 additions & 3 deletions gemfiles/rails_6.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,28 @@
source "https://rubygems.org"

gem "activerecord-jdbcpostgresql-adapter", platforms: [:jruby]
gem "appraisal", branch: "fix-bundle-env", git: "https://github.com/bensheldon/appraisal.git"
gem "appraisal", branch: "main", git: "https://github.com/thoughtbot/appraisal.git"
gem "matrix"
gem "nokogiri"
gem "pg", platforms: [:mri, :mingw, :x64_mingw]
gem "rack", "~> 2.0"
gem "rack", "~> 2.2"
gem "rails", "~> 6.0.0"
gem "traces", "~> 0.9.1"

platforms :ruby do
gem "activerecord-explain-analyze"
gem "activerecord-explain-analyze", require: false
gem "dotenv"
gem "foreman"
gem "gem-release"
gem "github_changelog_generator", require: false
gem "net-imap", require: false
gem "net-pop", require: false
gem "net-smtp", require: false
gem "pry-byebug"
gem "rack-mini-profiler"
gem "rbtrace"
gem "stackprof"
gem "tapioca", require: false, group: :development

group :lint do
gem "easy_translate"
Expand All @@ -24,6 +35,9 @@ platforms :ruby do
gem "rubocop-performance"
gem "rubocop-rails"
gem "rubocop-rspec"
gem "sorbet"
gem "sorbet-runtime"
gem "spoom", require: false
end
end

Expand Down
20 changes: 17 additions & 3 deletions gemfiles/rails_6.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,28 @@
source "https://rubygems.org"

gem "activerecord-jdbcpostgresql-adapter", platforms: [:jruby]
gem "appraisal", branch: "fix-bundle-env", git: "https://github.com/bensheldon/appraisal.git"
gem "appraisal", branch: "main", git: "https://github.com/thoughtbot/appraisal.git"
gem "matrix"
gem "nokogiri"
gem "pg", platforms: [:mri, :mingw, :x64_mingw]
gem "rack", "~> 2.0"
gem "rack", "~> 2.2"
gem "rails", "~> 6.1.0"
gem "traces", "~> 0.9.1"

platforms :ruby do
gem "activerecord-explain-analyze"
gem "activerecord-explain-analyze", require: false
gem "dotenv"
gem "foreman"
gem "gem-release"
gem "github_changelog_generator", require: false
gem "net-imap", require: false
gem "net-pop", require: false
gem "net-smtp", require: false
gem "pry-byebug"
gem "rack-mini-profiler"
gem "rbtrace"
gem "stackprof"
gem "tapioca", require: false, group: :development

group :lint do
gem "easy_translate"
Expand All @@ -24,6 +35,9 @@ platforms :ruby do
gem "rubocop-performance"
gem "rubocop-rails"
gem "rubocop-rspec"
gem "sorbet"
gem "sorbet-runtime"
gem "spoom", require: false
end
end

Expand Down
16 changes: 12 additions & 4 deletions gemfiles/rails_7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,24 @@ gem "appraisal", branch: "main", git: "https://github.com/thoughtbot/appraisal.g
gem "matrix"
gem "nokogiri"
gem "pg", platforms: [:mri, :mingw, :x64_mingw]
gem "rack", "~> 2.0"
gem "rack", "~> 2.2"
gem "rails", "~> 7.0.0"
gem "selenium-webdriver", "~> 4.0"

platforms :ruby do
gem "activerecord-explain-analyze", require: false
gem "dotenv"
gem "foreman"
gem "gem-release"
gem "github_changelog_generator", require: false
gem "net-imap", require: false
gem "net-pop", require: false
gem "net-smtp", require: false
gem "pry-byebug"
gem "rack-mini-profiler"
gem "rbtrace"
gem "stackprof"
gem "net-imap", require: false
gem "net-pop", require: false
gem "net-smtp", require: false
gem "tapioca", require: false, group: :development

group :lint do
gem "easy_translate"
Expand All @@ -30,6 +35,9 @@ platforms :ruby do
gem "rubocop-performance"
gem "rubocop-rails"
gem "rubocop-rspec"
gem "sorbet"
gem "sorbet-runtime"
gem "spoom", require: false
end
end

Expand Down
16 changes: 12 additions & 4 deletions gemfiles/rails_7.0_ruby_3.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,25 @@ gem "appraisal", branch: "main", git: "https://github.com/thoughtbot/appraisal.g
gem "matrix"
gem "nokogiri"
gem "pg", platforms: [:mri, :mingw, :x64_mingw]
gem "rack", "~> 2.0"
gem "rack", "~> 2.2"
gem "rails", "~> 7.0.1"
gem "capybara", "~> 3.36"
gem "selenium-webdriver", "~> 4.0"

platforms :ruby do
gem "activerecord-explain-analyze", require: false
gem "dotenv"
gem "foreman"
gem "gem-release"
gem "github_changelog_generator", require: false
gem "net-imap", require: false
gem "net-pop", require: false
gem "net-smtp", require: false
gem "pry-byebug"
gem "rack-mini-profiler"
gem "rbtrace"
gem "stackprof"
gem "net-imap", require: false
gem "net-pop", require: false
gem "net-smtp", require: false
gem "tapioca", require: false, group: :development

group :lint do
gem "easy_translate"
Expand All @@ -31,6 +36,9 @@ platforms :ruby do
gem "rubocop-performance"
gem "rubocop-rails"
gem "rubocop-rspec"
gem "sorbet"
gem "sorbet-runtime"
gem "spoom", require: false
end
end

Expand Down
16 changes: 12 additions & 4 deletions gemfiles/rails_head.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,25 @@ gem "appraisal", branch: "main", git: "https://github.com/thoughtbot/appraisal.g
gem "matrix"
gem "nokogiri"
gem "pg", platforms: [:mri, :mingw, :x64_mingw]
gem "rack", "~> 2.0"
gem "rack", "~> 2.2"
gem "rails", branch: "main", git: "https://github.com/rails/rails.git"
gem "capybara", "~> 3.36"
gem "selenium-webdriver", "~> 4.0"

platforms :ruby do
gem "activerecord-explain-analyze", require: false
gem "dotenv"
gem "foreman"
gem "gem-release"
gem "github_changelog_generator", require: false
gem "net-imap", require: false
gem "net-pop", require: false
gem "net-smtp", require: false
gem "pry-byebug"
gem "rack-mini-profiler"
gem "rbtrace"
gem "stackprof"
gem "net-imap", require: false
gem "net-pop", require: false
gem "net-smtp", require: false
gem "tapioca", require: false, group: :development

group :lint do
gem "easy_translate"
Expand All @@ -31,6 +36,9 @@ platforms :ruby do
gem "rubocop-performance"
gem "rubocop-rails"
gem "rubocop-rspec"
gem "sorbet"
gem "sorbet-runtime"
gem "spoom", require: false
end
end

Expand Down
24 changes: 19 additions & 5 deletions spec/support/reset_rails_queue_adapter.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
# frozen_string_literal: true

RSpec.configure do |config|
config.prepend_before do
# https://github.com/rails/rails/issues/37270
descendants = ActiveJob::Base.descendants + [ActiveJob::Base]
descendants.each(&:disable_test_adapter)
# https://github.com/rails/rails/issues/37270
# Avoid overriding TestQueueAdapter altogether
module ActiveJob
module TestHelper
# Avoid calling #descendants because JRuby has trouble with it
# https://github.com/jruby/jruby/issues/6896
def queue_adapter_changed_jobs
[]
end

module TestQueueAdapter
module ClassMethods
def queue_adapter # Lint/UselessMethodDefinition
super
end
end
end
end
end

RSpec.configure do |config|
config.around do |example|
original_adapter = ActiveJob::Base.queue_adapter

Expand Down

0 comments on commit 81af06c

Please sign in to comment.