-
-
Notifications
You must be signed in to change notification settings - Fork 513
Fix NoMethodError / Make session_tracking check consistent #2269
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
Fix NoMethodError / Make session_tracking check consistent #2269
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2269 +/- ##
=======================================
Coverage 97.61% 97.61%
=======================================
Files 112 112
Lines 4155 4155
=======================================
Hits 4056 4056
Misses 99 99
|
ab4423b
to
9a84215
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry for the bug and thanks for the fix!
This comment was marked as resolved.
This comment was marked as resolved.
Figured out the reason for #2269 (comment) It happens when we do in specs: require "sentry/test_helper"
RSpec.configure do |config|
config.include Sentry::TestHelper, sentry_test: true
config.before(sentry_test: true) { setup_sentry_test }
config.after(sentry_test: true) { teardown_sentry_test }
end |
Okay. Found how to reproduce the error: Sentry.init do |config|
# ...
config.enabled_environments = %w[staging production]
# ...
end Then using in specs: require "sentry/test_helper"
RSpec.configure do |config|
config.include Sentry::TestHelper
end
RSpec.describe "..." do
before { setup_sentry_test }
after { teardown_sentry_test }
# ...
end
|
Ensure enabled_environments contains test environment without mutating original list. See: getsentry#2269 (comment)
Ensure enabled_environments contains test environment without mutating original list. See: getsentry#2269 (comment)
Description
#2245 (cc @st0012 ) introduced changes around checking if session_tracking is enabled or not.. However, it wasn't updated in all necessary places and make it inconsistent within the codebase. As result, when not
enabled_in_current_env?
we're getting a following error:Affected version:
sentry-ruby 5.17.0