-
-
Notifications
You must be signed in to change notification settings - Fork 427
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
Hubs/Scopes Merge 40 - Scopes.isEnabled
now checks getClient().isEnabled()
#3385
Conversation
…pes-merge-2-add-scopes
…ainScopes to rootScopes
|
Performance metrics 🚀
|
val globalScope = Scope(options) | ||
val scopes = Scopes(mock<IScope>(), mock<IScope>(), globalScope, "test") | ||
// verify(integrationMock).register(expected, options) | ||
val scopes = createTestScopes(options) |
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.
Extracted this into test-support so we can reuse it and not have to set up mocks every time.
@@ -82,17 +89,25 @@ class SentryAppenderTest { | |||
|
|||
@Test | |||
fun `does not initialize Sentry if Sentry is already enabled`() { |
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.
afaict this test didn't actually test what it says it does. It used to just initialize Sentry via the log appender then reinitialize using Sentry.init
and it asserted that the env from re-init was set.
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.
Left a naming suggestion, otherwise, LGTM 👍
@@ -10,14 +11,14 @@ public final class EventProcessorUtils { | |||
|
|||
public static List<EventProcessor> unwrap( | |||
final @Nullable List<EventProcessorAndOrder> orderedEventProcessor) { |
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.
Maybe rename to eventProcessorsWithOrder
, same as in Scope.java
to make it clear that these are not ordered, but come with an order
.
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.
Will do in a follow up PR
@@ -2166,6 +2175,24 @@ class ScopesTest { | |||
assertEquals(span.spanContext.parentSpanId, txn.spanContext.spanId) | |||
} | |||
|
|||
@Test | |||
fun `is considered enabled if client is enabled()`() { | |||
val scopes = generateScopes() as Scopes |
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.
Cast to Scopes
is not needed
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.
Will change in a follow up PR
} | ||
|
||
@Test | ||
fun `is considered disabled if client is disabled()`() { |
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.
Cast to Scopes
is not needed
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.
Will change in a follow up PR
#skip-changelog
📜 Description
💡 Motivation and Context
Since
Scopes
are forked much more frequently thanHub
was, we can no longer storeisEnabled
as a property onScopes
as it would only affect a very limited scope (:D). By asking client we should by default now have the same state globally unless a customer sets a different client.💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps