Skip to content

Fix jruby on CI #2609

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .github/workflows/sentry_delayed_job_test.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 1 addition & 6 deletions .github/workflows/sentry_opentelemetry_test.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 2 additions & 6 deletions .github/workflows/sentry_rails_test.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 3 additions & 7 deletions .github/workflows/sentry_resque_test.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 3 additions & 7 deletions .github/workflows/sentry_ruby_test.yml
Original file line number Diff line number Diff line change
@@ -53,20 +53,16 @@ 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

- 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@c169aa53af4cd5d9321e9114669dbd11be08d307
14 changes: 5 additions & 9 deletions .github/workflows/sentry_sidekiq_test.yml
Original file line number Diff line number Diff line change
@@ -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
@@ -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
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions sentry-rails/spec/sentry/rails/activejob_spec.rb
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 1 addition & 3 deletions sentry-sidekiq/Gemfile
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion sentry-sidekiq/spec/sentry/sidekiq_spec.rb
Original file line number Diff line number Diff line change
@@ -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
Loading