Fix NoMethodError / Make session_tracking check consistent#2269
Merged
st0012 merged 2 commits intogetsentry:masterfrom Mar 14, 2024
Merged
Fix NoMethodError / Make session_tracking check consistent#2269st0012 merged 2 commits intogetsentry:masterfrom
st0012 merged 2 commits intogetsentry:masterfrom
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
st0012
approved these changes
Mar 14, 2024
Contributor
st0012
left a comment
There was a problem hiding this comment.
Ah sorry for the bug and thanks for the fix!
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
|
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 |
Contributor
|
Okay. Found how to reproduce the error: Sentry.init do |config|
# ...
config.enabled_environments = %w[staging production]
# ...
endThen 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
|
ixti
added a commit
to ixti/sentry-ruby
that referenced
this pull request
Mar 17, 2024
Ensure enabled_environments contains test environment without mutating original list. See: getsentry#2269 (comment)
ixti
added a commit
to ixti/sentry-ruby
that referenced
this pull request
Mar 22, 2024
Ensure enabled_environments contains test environment without mutating original list. See: getsentry#2269 (comment)
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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