From 6078035811adaacc325e4ab2eef9cba97b45f31a Mon Sep 17 00:00:00 2001 From: Orien Madgwick <497874+orien@users.noreply.github.com> Date: Sun, 18 Feb 2024 20:46:55 +1100 Subject: [PATCH 1/8] CI: bump actions/checkout from v2 to v4 --- .github/workflows/ci.yml | 2 +- .github/workflows/rubocop.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31b73af00..9fd07d40a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: continue-on-error: ${{ matrix.rails_version == 'edge' || endsWith(matrix.ruby, 'head') }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 env: RAILS_VERSION: ${{ matrix.rails_version }} diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 739473987..57bd319f0 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Ruby 2.7 uses: ruby/setup-ruby@v1 with: From 17b7f6744dae416abc2eef0ff1cc8d4328eb30cb Mon Sep 17 00:00:00 2001 From: Orien Madgwick <497874+orien@users.noreply.github.com> Date: Sun, 18 Feb 2024 20:46:09 +1100 Subject: [PATCH 2/8] CI: add Ruby 3.3 to the test matrix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9fd07d40a..a5180e5f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['2.7', '3.0', '3.1', '3.2', jruby-head, ruby-head] + ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', jruby-head, ruby-head] rails_version: - '6.0.0' - '6.1.0' From b93473460c1801c2ebc5f72ae730be5c63bc738f Mon Sep 17 00:00:00 2001 From: Orien Madgwick <497874+orien@users.noreply.github.com> Date: Sun, 18 Feb 2024 21:09:39 +1100 Subject: [PATCH 3/8] CI: move legacy versions in test matrix --- .github/workflows/ci.yml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5180e5f1..5807566c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,26 +12,27 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', jruby-head, ruby-head] + ruby: ['3.1', '3.2', '3.3', jruby-head, ruby-head] rails_version: - - '6.0.0' - '6.1.0' - '7.0.0' - 'edge' include: - # Rails 5.2 + # Ruby 2.6 - ruby: 2.6 - rails_version: '5.2.0' + rails_version: '6.1.0' + + # Ruby 2.7 - ruby: 2.7 - rails_version: '5.2.0' - - ruby: jruby-9.2 - rails_version: '5.2.0' + rails_version: '6.1.0' + - ruby: 2.7 + rails_version: '7.0.0' - # Ruby 2.6 - - ruby: 2.6 - rails_version: '6.0.0' - - ruby: 2.6 + # Ruby 3.0 + - ruby: '3.0' rails_version: '6.1.0' + - ruby: '3.0' + rails_version: '7.0.0' # jruby-9.2 - ruby: jruby-9.2 @@ -42,8 +43,6 @@ jobs: # jruby-9.4 - ruby: jruby-9.4 rails_version: '7.0.0' - - ruby: jruby-9.4 - rails_version: 'edge' # # The past @@ -59,6 +58,10 @@ jobs: rails_version: '5.0.0' - ruby: 2.5 rails_version: '5.1.0' + - ruby: 2.6 + rails_version: '5.2.0' + - ruby: 2.7 + rails_version: '6.0.0' continue-on-error: ${{ matrix.rails_version == 'edge' || endsWith(matrix.ruby, 'head') }} From 137fd0d811c84a4b659e08a6d6de7932353b8f49 Mon Sep 17 00:00:00 2001 From: Orien Madgwick <497874+orien@users.noreply.github.com> Date: Sun, 18 Feb 2024 21:24:22 +1100 Subject: [PATCH 4/8] CI: add Rails 7.1 to the test matrix --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5807566c4..b46608d73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ jobs: rails_version: - '6.1.0' - '7.0.0' + - '7.1.0' - 'edge' include: # Ruby 2.6 From 0a8bc8dc5772ab6bdd6127dded0f0b7f010461cc Mon Sep 17 00:00:00 2001 From: Orien Madgwick <497874+orien@users.noreply.github.com> Date: Mon, 19 Feb 2024 20:38:03 +1100 Subject: [PATCH 5/8] CI: be precise regarding the Ubuntu version Older versions of Ruby segfault on newer versions of Ubuntu. --- .github/workflows/ci.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b46608d73..d9f38fe55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,8 @@ on: jobs: test: - runs-on: ubuntu-latest + name: Test (Ruby ${{ matrix.ruby }}, Rails ${{ matrix.rails_version }}) + runs-on: ubuntu-${{ matrix.ubuntu }} strategy: fail-fast: false matrix: @@ -18,32 +19,41 @@ jobs: - '7.0.0' - '7.1.0' - 'edge' + ubuntu: [latest] include: # Ruby 2.6 - ruby: 2.6 rails_version: '6.1.0' + ubuntu: '20.04' # Ruby 2.7 - ruby: 2.7 rails_version: '6.1.0' + ubuntu: '20.04' - ruby: 2.7 rails_version: '7.0.0' + ubuntu: '20.04' # Ruby 3.0 - ruby: '3.0' rails_version: '6.1.0' + ubuntu: '22.04' - ruby: '3.0' rails_version: '7.0.0' + ubuntu: '22.04' # jruby-9.2 - ruby: jruby-9.2 rails_version: '6.0.0' + ubuntu: '20.04' - ruby: jruby-9.2 rails_version: '6.1.0' + ubuntu: '20.04' # jruby-9.4 - ruby: jruby-9.4 rails_version: '7.0.0' + ubuntu: '22.04' # # The past @@ -51,18 +61,25 @@ jobs: # EOL Active Record - ruby: 2.2 rails_version: '3.2.0' + ubuntu: '20.04' - ruby: 2.1 rails_version: '4.1.0' + ubuntu: '20.04' - ruby: 2.4 rails_version: '4.2.0' + ubuntu: '20.04' - ruby: 2.4 rails_version: '5.0.0' + ubuntu: '20.04' - ruby: 2.5 rails_version: '5.1.0' + ubuntu: '20.04' - ruby: 2.6 rails_version: '5.2.0' + ubuntu: '20.04' - ruby: 2.7 rails_version: '6.0.0' + ubuntu: '20.04' continue-on-error: ${{ matrix.rails_version == 'edge' || endsWith(matrix.ruby, 'head') }} From cae4338386df9a3842dae163873f219320e5602e Mon Sep 17 00:00:00 2001 From: Orien Madgwick <497874+orien@users.noreply.github.com> Date: Mon, 19 Feb 2024 21:07:16 +1100 Subject: [PATCH 6/8] Restrict `loofah` when running tests on old Ruby versions --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index c66ff6e7e..6fb786387 100644 --- a/Gemfile +++ b/Gemfile @@ -67,6 +67,7 @@ group :test do if ENV['RAILS_VERSION'].nil? || ENV['RAILS_VERSION'] >= '6.0.0' gem 'zeitwerk', :require => false end + gem 'loofah', '< 2.21.0', :require => false if RUBY_VERSION < '2.6' end group :rubocop do From 0469b0940fd51def20c258bc8f6c3afe1176d8f3 Mon Sep 17 00:00:00 2001 From: Orien Madgwick <497874+orien@users.noreply.github.com> Date: Mon, 19 Feb 2024 21:18:35 +1100 Subject: [PATCH 7/8] Loosen test expectation to match Ruby 3.4 backtrace --- lib/delayed/backend/shared_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/delayed/backend/shared_spec.rb b/lib/delayed/backend/shared_spec.rb index 39f497670..95e699505 100644 --- a/lib/delayed/backend/shared_spec.rb +++ b/lib/delayed/backend/shared_spec.rb @@ -595,7 +595,7 @@ def create_job(opts = {}) worker.work_off @job.reload expect(@job.last_error).to match(/did not work/) - expect(@job.last_error).to match(/sample_jobs.rb:\d+:in `perform'/) + expect(@job.last_error).to match(/sample_jobs.rb:\d+:in [`'](ErrorJob#)?perform'/) expect(@job.attempts).to eq(1) expect(@job.run_at).to be > Delayed::Job.db_time_now - 10.minutes expect(@job.run_at).to be < Delayed::Job.db_time_now + 10.minutes From c45899b986da661afe20ae486b845d3139350df8 Mon Sep 17 00:00:00 2001 From: Orien Madgwick <497874+orien@users.noreply.github.com> Date: Mon, 19 Feb 2024 21:25:01 +1100 Subject: [PATCH 8/8] Add conditional test dependency on `base64`, `mutex_m`, `bigdecimal` --- Gemfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Gemfile b/Gemfile index 6fb786387..02b671692 100644 --- a/Gemfile +++ b/Gemfile @@ -68,6 +68,14 @@ group :test do gem 'zeitwerk', :require => false end gem 'loofah', '< 2.21.0', :require => false if RUBY_VERSION < '2.6' + + # TODO: remove these requires once activesupport has such dependencies + # in all versions of Rails we test against on Ruby >=3.4 (and head). + if RUBY_VERSION >= '3.4' + gem 'base64', :require => false + gem 'bigdecimal', :require => false + gem 'mutex_m', :require => false + end end group :rubocop do