Skip to content

Commit

Permalink
Pin sentry-sidekiq's Rails version
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 committed Oct 7, 2023
1 parent 8c217dc commit 3636da7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
11 changes: 7 additions & 4 deletions sentry-sidekiq/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@ gem "rexml"
gem "loofah", "2.20.0" if RUBY_VERSION.to_f < 2.5

sidekiq_version = ENV["SIDEKIQ_VERSION"]
sidekiq_version = "6.0" if sidekiq_version.nil?
sidekiq_version = Gem::Version.new("6.0") if sidekiq_version.nil?

gem "sidekiq", "~> #{sidekiq_version}"
gem "rails"
if sidekiq_version >= Gem::Version.new("7.0")
gem "sidekiq", github: "sidekiq/sidekiq"
else
gem "sidekiq", "~> #{sidekiq_version}"
end
gem "rails", "> 5.0.0", "< 7.1.0"

if RUBY_VERSION.to_f >= 2.6
gem "debug", github: "ruby/debug", platform: :ruby
gem "irb"
end

gem "pry"

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
execute_worker(processor, SadWorker)

expect(transport.events.count).to eq(1)
event = transport.events.first
event = transport.events[0]
expect(event.user).to eq(user)
end

Expand All @@ -36,7 +36,7 @@
execute_worker(processor, HappyWorker)

expect(transport.events.count).to eq(1)
transaction = transport.events.first
transaction = transport.events[0]
expect(transaction).not_to be_nil
expect(transaction.user).to eq(user)
end
Expand All @@ -45,7 +45,7 @@
execute_worker(processor, SadWorker)

expect(transport.events.count).to eq(2)
transaction = transport.events.first
transaction = transport.events[0]
expect(transaction.user).to eq(user)
event = transport.events.last
expect(event.user).to eq(user)
Expand All @@ -65,7 +65,7 @@
execute_worker(processor, HappyWorker, trace_propagation_headers: trace_propagation_headers)

expect(transport.events.count).to eq(1)
transaction = transport.events.first
transaction = transport.events[0]
expect(transaction).not_to be_nil
expect(transaction.contexts.dig(:trace, :trace_id)).to eq(parent_transaction.trace_id)
end
Expand Down Expand Up @@ -140,11 +140,11 @@

q = queue.to_a
expect(q.size).to be(2)
first_headers = q.first["trace_propagation_headers"]
first_headers = q[0]["trace_propagation_headers"]
expect(first_headers["sentry-trace"]).to eq(transaction.to_sentry_trace)
expect(first_headers["baggage"]).to eq(transaction.to_baggage)

second_headers = q.second["trace_propagation_headers"]
second_headers = q[1]["trace_propagation_headers"]
expect(second_headers["sentry-trace"]).to eq(transaction.to_sentry_trace)
expect(second_headers["baggage"]).to eq(transaction.to_baggage)
end
Expand Down

0 comments on commit 3636da7

Please sign in to comment.