Repository navigation
feat(android): Enable standalone app start tracing by default #6716
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
base: 9.x.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -555,7 +555,10 @@ class ActivityLifecycleIntegrationTest { | |
|
|
||
| @Test | ||
| fun `extendAppStart is a no-op when standalone tracing is disabled`() { | ||
| val sut = fixture.getSut { it.tracesSampleRate = 1.0 } | ||
| val sut = fixture.getSut { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test assumes one ui.load transactionMedium Severity This test calls Triggered by project rule: PR Review Guidelines for Cursor Bugbot Reviewed by Cursor Bugbot for commit 6f0879b. Configure here. |
||
| it.tracesSampleRate = 1.0 | ||
| it.isEnableStandaloneAppStartTracing = false | ||
| } | ||
| sut.register(fixture.scopes, fixture.options) | ||
|
|
||
| setAppStartTime() | ||
|
|
@@ -627,7 +630,10 @@ class ActivityLifecycleIntegrationTest { | |
|
|
||
| @Test | ||
| fun `HeadlessAppStartListener is not registered when standalone flag is off`() { | ||
| val sut = fixture.getSut { it.tracesSampleRate = 1.0 } | ||
| val sut = fixture.getSut { | ||
| it.tracesSampleRate = 1.0 | ||
| it.isEnableStandaloneAppStartTracing = false | ||
| } | ||
| sut.register(fixture.scopes, fixture.options) | ||
| prepareHeadlessAppStart() | ||
|
|
||
|
|
@@ -1004,6 +1010,7 @@ class ActivityLifecycleIntegrationTest { | |
| fun `When Activity is destroyed, sets appStartSpan status to cancelled and finish it`() { | ||
| val sut = fixture.getSut() | ||
| fixture.options.tracesSampleRate = 1.0 | ||
| fixture.options.isEnableStandaloneAppStartTracing = false | ||
| sut.register(fixture.scopes, fixture.options) | ||
|
|
||
| setAppStartTime() | ||
|
|
@@ -1220,6 +1227,7 @@ class ActivityLifecycleIntegrationTest { | |
| fun `When firstActivityCreated is false, start transaction with given appStartTime`() { | ||
| val sut = fixture.getSut() | ||
| fixture.options.tracesSampleRate = 1.0 | ||
| fixture.options.isEnableStandaloneAppStartTracing = false | ||
| sut.register(fixture.scopes, fixture.options) | ||
| sut.setFirstActivityCreated(false) | ||
|
|
||
|
|
@@ -1244,7 +1252,10 @@ class ActivityLifecycleIntegrationTest { | |
| @Test | ||
| fun `When firstActivityCreated is false and app start sampling decision is set, start transaction with isAppStart true`() { | ||
| AppStartMetrics.getInstance().appStartSamplingDecision = mock() | ||
| val sut = fixture.getSut { it.tracesSampleRate = 1.0 } | ||
| val sut = fixture.getSut { | ||
| it.tracesSampleRate = 1.0 | ||
| it.isEnableStandaloneAppStartTracing = false | ||
| } | ||
| sut.register(fixture.scopes, fixture.options) | ||
| sut.setFirstActivityCreated(false) | ||
|
|
||
|
|
@@ -1267,7 +1278,10 @@ class ActivityLifecycleIntegrationTest { | |
|
|
||
| @Test | ||
| fun `When firstActivityCreated is false and app start sampling decision is not set, start transaction with isAppStart false`() { | ||
| val sut = fixture.getSut { it.tracesSampleRate = 1.0 } | ||
| val sut = fixture.getSut { | ||
| it.tracesSampleRate = 1.0 | ||
| it.isEnableStandaloneAppStartTracing = false | ||
| } | ||
| sut.register(fixture.scopes, fixture.options) | ||
| sut.setFirstActivityCreated(false) | ||
|
|
||
|
|
@@ -1641,7 +1655,10 @@ class ActivityLifecycleIntegrationTest { | |
|
|
||
| @Test | ||
| fun `standalone flag off launcher activity emits single ui load with nested app start cold child`() { | ||
| val sut = fixture.getSut { it.tracesSampleRate = 1.0 } | ||
| val sut = fixture.getSut { | ||
| it.tracesSampleRate = 1.0 | ||
| it.isEnableStandaloneAppStartTracing = false | ||
| } | ||
| sut.register(fixture.scopes, fixture.options) | ||
| setAppStartTime() | ||
|
|
||
|
|
@@ -2402,6 +2419,7 @@ class ActivityLifecycleIntegrationTest { | |
| fun `Creates activity lifecycle spans on API lower than 29`() { | ||
| val sut = fixture.getSut(apiVersion = Build.VERSION_CODES.P) | ||
| fixture.options.tracesSampleRate = 1.0 | ||
| fixture.options.isEnableStandaloneAppStartTracing = false | ||
| val appStartDate = SentryNanotimeDate(1, 0) | ||
| val startDate = SentryNanotimeDate(2, 0) | ||
| val appStartMetrics = AppStartMetrics.getInstance() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,6 +74,7 @@ class SdkInitTests : BaseUiTest() { | |
| transaction2.finish() | ||
|
|
||
| relay.assert { | ||
| assertAppStartTransaction() | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. App start assert races with re-initMedium Severity
Additional Locations (2)Triggered by project rule: AGENTS.md Reviewed by Cursor Bugbot for commit a151e1b. Configure here. |
||
| findEnvelope { | ||
| assertEnvelopeTransaction(it.items.toList(), AndroidLogger()).transaction == "e2etests" | ||
| } | ||
|
|
||


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.