From accb0bef54fa17a454f29ee2264a0a0477a3161b Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Mon, 28 Apr 2025 11:35:29 +0000 Subject: [PATCH 1/5] [ci] update jruby versions - add jruby-9.4.12.0 explicitly because "jruby" in versions means 10.0.0.0 now - *exclude* jruby 10.0.0.0 in test suites where it fails --- .github/workflows/sentry_delayed_job_test.yml | 7 +------ .github/workflows/sentry_opentelemetry_test.yml | 7 +------ .github/workflows/sentry_rails_test.yml | 8 ++------ .github/workflows/sentry_resque_test.yml | 10 +++------- .github/workflows/sentry_ruby_test.yml | 10 +++------- .github/workflows/sentry_sidekiq_test.yml | 8 ++------ .github/workflows/tests.yml | 1 + 7 files changed, 13 insertions(+), 38 deletions(-) diff --git a/.github/workflows/sentry_delayed_job_test.yml b/.github/workflows/sentry_delayed_job_test.yml index d9dcf8447..2788b8b43 100644 --- a/.github/workflows/sentry_delayed_job_test.yml +++ b/.github/workflows/sentry_delayed_job_test.yml @@ -57,12 +57,7 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby_version }} - bundler-cache: ${{ ! contains(matrix.ruby_version, 'jruby') }} - - # https://github.com/jruby/jruby/issues/8606#issuecomment-2641501008 - - name: Bundle Jruby - if: ${{ contains(matrix.ruby_version, 'jruby') }} - run: gem install jar-dependencies && bundle + bundler-cache: true - name: Run specs run: bundle exec rake diff --git a/.github/workflows/sentry_opentelemetry_test.yml b/.github/workflows/sentry_opentelemetry_test.yml index 2e80c7bda..f7dea70d4 100644 --- a/.github/workflows/sentry_opentelemetry_test.yml +++ b/.github/workflows/sentry_opentelemetry_test.yml @@ -46,12 +46,7 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby_version }} - bundler-cache: ${{ ! contains(matrix.ruby_version, 'jruby') }} - - # https://github.com/jruby/jruby/issues/8606#issuecomment-2641501008 - - name: Bundle Jruby - if: ${{ contains(matrix.ruby_version, 'jruby') }} - run: gem install jar-dependencies && bundle + bundler-cache: true - name: Run specs run: bundle exec rake diff --git a/.github/workflows/sentry_rails_test.yml b/.github/workflows/sentry_rails_test.yml index 0eda4d1b2..71375e8f1 100644 --- a/.github/workflows/sentry_rails_test.yml +++ b/.github/workflows/sentry_rails_test.yml @@ -90,6 +90,7 @@ jobs: rails_version: 7.1.0 exclude: - ruby_version: head + - ruby_version: 'jruby' - ruby_version: jruby-head - ruby_version: "3.4" rails_version: "6.1.0" @@ -108,12 +109,7 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby_version }} - bundler-cache: ${{ ! contains(matrix.ruby_version, 'jruby') }} - - # https://github.com/jruby/jruby/issues/8606#issuecomment-2641501008 - - name: Bundle Jruby - if: ${{ contains(matrix.ruby_version, 'jruby') }} - run: gem install jar-dependencies && bundle + bundler-cache: true - name: Build with Rails ${{ matrix.rails_version }} run: bundle exec rake diff --git a/.github/workflows/sentry_resque_test.yml b/.github/workflows/sentry_resque_test.yml index f1ea567af..8d4b5904e 100644 --- a/.github/workflows/sentry_resque_test.yml +++ b/.github/workflows/sentry_resque_test.yml @@ -36,19 +36,15 @@ jobs: options: rubyopt: "--enable-frozen-string-literal --debug=frozen-string-literal" exclude: - - { ruby_version: 'jruby-head' } + - ruby_version: 'jruby' + - ruby_version: 'jruby-head' steps: - uses: actions/checkout@v4 - name: Set up Ruby ${{ matrix.ruby_version }} uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby_version }} - bundler-cache: ${{ ! contains(matrix.ruby_version, 'jruby') }} - - # https://github.com/jruby/jruby/issues/8606#issuecomment-2641501008 - - name: Bundle Jruby - if: ${{ contains(matrix.ruby_version, 'jruby') }} - run: gem install jar-dependencies && bundle + bundler-cache: true - name: Start Redis uses: supercharge/redis-github-action@1.1.0 diff --git a/.github/workflows/sentry_ruby_test.yml b/.github/workflows/sentry_ruby_test.yml index 7d079e0ef..05545ba08 100644 --- a/.github/workflows/sentry_ruby_test.yml +++ b/.github/workflows/sentry_ruby_test.yml @@ -53,7 +53,8 @@ jobs: rack_version: 3.1 redis_rb_version: 5.3 exclude: - - { ruby_version: 'jruby-head' } + - ruby_version: 'jruby' + - ruby_version: 'jruby-head' steps: - uses: actions/checkout@v4 @@ -61,12 +62,7 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby_version }} - bundler-cache: ${{ ! contains(matrix.ruby_version, 'jruby') }} - - # https://github.com/jruby/jruby/issues/8606#issuecomment-2641501008 - - name: Bundle Jruby - if: ${{ contains(matrix.ruby_version, 'jruby') }} - run: gem install jar-dependencies && bundle + bundler-cache: true - name: Start Redis uses: supercharge/redis-github-action@c169aa53af4cd5d9321e9114669dbd11be08d307 diff --git a/.github/workflows/sentry_sidekiq_test.yml b/.github/workflows/sentry_sidekiq_test.yml index 861b57254..ac2a0308c 100644 --- a/.github/workflows/sentry_sidekiq_test.yml +++ b/.github/workflows/sentry_sidekiq_test.yml @@ -62,6 +62,7 @@ jobs: sidekiq_version: 8.0.0.beta1 exclude: - ruby_version: head + - ruby_version: jruby - ruby_version: jruby-head steps: - uses: actions/checkout@v4 @@ -70,12 +71,7 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby_version }} - bundler-cache: ${{ ! contains(matrix.ruby_version, 'jruby') }} - - # https://github.com/jruby/jruby/issues/8606#issuecomment-2641501008 - - name: Bundle Jruby - if: ${{ contains(matrix.ruby_version, 'jruby') }} - run: gem install jar-dependencies && bundle + bundler-cache: true - name: Start Redis uses: supercharge/redis-github-action@1.1.0 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 92d567d77..bcba977d4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,6 +18,7 @@ jobs: with: engine: cruby-jruby min_version: 2.7 + versions: '["jruby-9.4.12.0"]' delayed_job-tests: needs: ruby-versions From 678760bb262dfaa93e88d9b0a7463bd50f51e715 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Tue, 29 Apr 2025 09:55:33 +0000 Subject: [PATCH 2/5] [sidekiq] skip installing vernier on jruby --- sentry-sidekiq/Gemfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sentry-sidekiq/Gemfile b/sentry-sidekiq/Gemfile index ccc3b3ce2..aaacbf5a3 100644 --- a/sentry-sidekiq/Gemfile +++ b/sentry-sidekiq/Gemfile @@ -35,6 +35,4 @@ gem "rails", "> 5.0.0" gem "timecop" -if RUBY_VERSION >= "3.2.1" - gem "vernier" -end +gem "vernier", platforms: :ruby if RUBY_VERSION >= "3.2.1" From 8436bf77bbc6ad9559c134d293bac02b074afaa2 Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Tue, 29 Apr 2025 10:50:44 +0000 Subject: [PATCH 3/5] [rails] skip problematic specs (see #2612) --- sentry-rails/spec/sentry/rails/activejob_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sentry-rails/spec/sentry/rails/activejob_spec.rb b/sentry-rails/spec/sentry/rails/activejob_spec.rb index e9d65b31f..551a0be27 100644 --- a/sentry-rails/spec/sentry/rails/activejob_spec.rb +++ b/sentry-rails/spec/sentry/rails/activejob_spec.rb @@ -435,6 +435,12 @@ def perform(event, hint) end describe "active_job_report_after_job_retries", skip: RAILS_VERSION < 7.0 do + before do + if defined?(JRUBY_VERSION) && JRUBY_VERSION == "9.4.12.0" && RAILS_VERSION <= 7.1 + skip "This crashes on jruby + rails 7.0.0.x. See https://github.com/getsentry/sentry-ruby/issues/2612" + end + end + context "when active_job_report_after_job_retries is false" do it "reports 3 exceptions" do allow(Sentry::Rails::ActiveJobExtensions::SentryReporter) From 887733d84d5a7541ec0c41660885079d6a4fbfad Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Tue, 29 Apr 2025 11:08:47 +0000 Subject: [PATCH 4/5] [sidekiq] skip vernier spec --- sentry-sidekiq/spec/sentry/sidekiq_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry-sidekiq/spec/sentry/sidekiq_spec.rb b/sentry-sidekiq/spec/sentry/sidekiq_spec.rb index 14e1caf46..de65bb074 100644 --- a/sentry-sidekiq/spec/sentry/sidekiq_spec.rb +++ b/sentry-sidekiq/spec/sentry/sidekiq_spec.rb @@ -363,7 +363,7 @@ def retry_last_failed_job end end - context "when profiling is enabled with Vernier", skip: RUBY_VERSION < "3.2.1" do + context "when profiling is enabled with Vernier", skip: !defined?(Vernier) do before do perform_basic_setup do |config| config.traces_sample_rate = 1.0 From be4992b682e2bc359081f5e3388638047c0ea0ea Mon Sep 17 00:00:00 2001 From: Peter Solnica Date: Tue, 29 Apr 2025 11:11:32 +0000 Subject: [PATCH 5/5] [sidekiq] restore running tests against jruby 9.4.x --- .github/workflows/sentry_sidekiq_test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sentry_sidekiq_test.yml b/.github/workflows/sentry_sidekiq_test.yml index ac2a0308c..4db2784f7 100644 --- a/.github/workflows/sentry_sidekiq_test.yml +++ b/.github/workflows/sentry_sidekiq_test.yml @@ -44,11 +44,11 @@ jobs: sidekiq_version: 5.0 - ruby_version: 2.6 sidekiq_version: 6.0 - - ruby_version: jruby + - ruby_version: jruby-9.4.12.0 sidekiq_version: 5.0 - - ruby_version: jruby + - ruby_version: jruby-9.4.12.0 sidekiq_version: 6.0 - - ruby_version: jruby + - ruby_version: jruby-9.4.12.0 sidekiq_version: 7.0 - ruby_version: "3.2" sidekiq_version: 7.0