Set user to the current scope via sidekiq middleware#1469
Set user to the current scope via sidekiq middleware#1469st0012 merged 1 commit intogetsentry:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1469 +/- ##
==========================================
+ Coverage 98.24% 98.74% +0.49%
==========================================
Files 214 120 -94
Lines 10156 6350 -3806
==========================================
- Hits 9978 6270 -3708
+ Misses 178 80 -98
Continue to review full report at Codecov.
|
sentry-sidekiq/spec/sentry/sidekiq/sentry_context_middleware_spec.rb
Outdated
Show resolved
Hide resolved
sentry-sidekiq/spec/sentry/sidekiq/sentry_context_middleware_spec.rb
Outdated
Show resolved
Hide resolved
56e42c9 to
22366eb
Compare
sentry-sidekiq/spec/sentry/sidekiq/sentry_context_middleware_spec.rb
Outdated
Show resolved
Hide resolved
22366eb to
e12dcc6
Compare
e12dcc6 to
c903d43
Compare
|
|
||
| queue = random_empty_queue | ||
| options = { fetch: Sidekiq::BasicFetch.new(queues: [queue.name]) } | ||
| processor = Sidekiq::Processor.new(nil, options) |
There was a problem hiding this comment.
I think the way you initialize sidekiq processor is not compatible with sidekiq v5.2 (which runs in Ruby 2.4 test suite).
instead of initializing the processor directly, can we initialize a manager and get the processor from it? like
sentry-ruby/sentry-sidekiq/spec/sentry/sidekiq_spec.rb
Lines 15 to 19 in 6d2fc60
I will merge this PR once the test is fixed 🙂
There was a problem hiding this comment.
actually it still fails with Sidekiq 5
There was a problem hiding this comment.
Ran tests with sidekiq 5 and confirmed it works.
c903d43 to
70bf1b6
Compare
70bf1b6 to
f674c58
Compare
|
|
||
| client.push('queue' => queue.name, 'class' => SadWorker, 'args' => []) | ||
|
|
||
| # XXX: In ruby 2.4, two events are pushed. In other versions, only one |
There was a problem hiding this comment.
I'll check this in a follow up PR.
st0012
left a comment
There was a problem hiding this comment.
thanks for the contribution 👍
I'll add another PR to refactor the test cases and add changelog entry for this.
|
Thanks a lot for the help 👍 |
Close #1468.