test(profiling): pin Android RNSentryStart wiring of _experiments.profilingOptions#6060
Open
test(profiling): pin Android RNSentryStart wiring of _experiments.profilingOptions#6060
Conversation
…filingOptions Add JUnit coverage for `RNSentryStart.configureAndroidProfiling` to catch a future refactor moving it out of the live `getSentryAndroidOptions` call site — the same regression shape as the iOS bug fixed in #6012, which slipped through because the Android side had zero coverage for this wiring. Closes #6016. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📲 Install BuildsAndroid
|
Contributor
Android (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4953e94+dirty | 442.02 ms | 456.52 ms | 14.50 ms |
| 2c735cc+dirty | 414.09 ms | 438.47 ms | 24.38 ms |
| df5d108+dirty | 527.06 ms | 603.58 ms | 76.52 ms |
| 3ce5254+dirty | 410.57 ms | 448.48 ms | 37.91 ms |
| 3d377b5+dirty | 406.18 ms | 453.52 ms | 47.34 ms |
| 0d9949d+dirty | 403.57 ms | 437.00 ms | 33.43 ms |
| 4b87b12+dirty | 421.82 ms | 413.60 ms | -8.22 ms |
| 7ac3378+dirty | 404.78 ms | 439.84 ms | 35.06 ms |
| 890d145+dirty | 504.54 ms | 491.55 ms | -12.99 ms |
| 3817909+dirty | 406.67 ms | 416.58 ms | 9.91 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4953e94+dirty | 43.75 MiB | 48.08 MiB | 4.33 MiB |
| 2c735cc+dirty | 43.75 MiB | 48.08 MiB | 4.33 MiB |
| df5d108+dirty | 43.75 MiB | 48.08 MiB | 4.33 MiB |
| 3ce5254+dirty | 43.75 MiB | 48.12 MiB | 4.37 MiB |
| 3d377b5+dirty | 43.75 MiB | 48.14 MiB | 4.39 MiB |
| 0d9949d+dirty | 43.75 MiB | 48.13 MiB | 4.37 MiB |
| 4b87b12+dirty | 43.75 MiB | 48.14 MiB | 4.39 MiB |
| 7ac3378+dirty | 43.75 MiB | 48.13 MiB | 4.37 MiB |
| 890d145+dirty | 43.75 MiB | 48.14 MiB | 4.39 MiB |
| 3817909+dirty | 43.75 MiB | 48.08 MiB | 4.33 MiB |
Contributor
Android (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4953e94+dirty | 398.80 ms | 431.81 ms | 33.01 ms |
| 2c735cc+dirty | 435.20 ms | 459.48 ms | 24.28 ms |
| df5d108+dirty | 434.82 ms | 447.39 ms | 12.57 ms |
| 3ce5254+dirty | 373.90 ms | 427.84 ms | 53.94 ms |
| 3d377b5+dirty | 425.38 ms | 440.67 ms | 15.30 ms |
| 0d9949d+dirty | 414.88 ms | 428.68 ms | 13.81 ms |
| 4b87b12+dirty | 356.23 ms | 399.86 ms | 43.63 ms |
| 7ac3378+dirty | 410.67 ms | 442.60 ms | 31.92 ms |
| 890d145+dirty | 486.42 ms | 514.85 ms | 28.43 ms |
| 3817909+dirty | 357.52 ms | 391.52 ms | 34.00 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4953e94+dirty | 43.94 MiB | 48.94 MiB | 5.00 MiB |
| 2c735cc+dirty | 43.94 MiB | 48.94 MiB | 5.00 MiB |
| df5d108+dirty | 43.94 MiB | 48.94 MiB | 5.00 MiB |
| 3ce5254+dirty | 43.94 MiB | 48.98 MiB | 5.04 MiB |
| 3d377b5+dirty | 43.94 MiB | 49.00 MiB | 5.06 MiB |
| 0d9949d+dirty | 43.94 MiB | 48.99 MiB | 5.05 MiB |
| 4b87b12+dirty | 43.94 MiB | 49.00 MiB | 5.06 MiB |
| 7ac3378+dirty | 43.94 MiB | 48.99 MiB | 5.05 MiB |
| 890d145+dirty | 43.94 MiB | 49.00 MiB | 5.06 MiB |
| 3817909+dirty | 43.94 MiB | 48.94 MiB | 5.00 MiB |
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.
📢 Type of change
📜 Description
Adds a new JUnit test class
RNSentryProfilingOptionsTestunderpackages/core/RNSentryAndroidTester/app/src/test/java/io/sentry/react/that pins the wiring of_experiments.profilingOptionsfrom the JS bridge intoSentryAndroidOptionsviaRNSentryStart.configureAndroidProfiling.The 11 tests cover:
profileSessionSampleRate,lifecycle: "trace",startOnAppStart: true→options.profileSessionSampleRate == 1.0,profileLifecycle == TRACE,isStartProfilerOnAppStart == true).lifecycle: "manual"→ProfileLifecycle.MANUAL.lifecycle: "TRACE"→ case-insensitive match.startOnAppStart: falseis honored._experimentsis missing, when_experimentshas noprofilingOptions, and whenprofilingOptionsis empty.profileSessionSampleRate, number forlifecycle, string forstartOnAppStart) log aSentryLevel.WARNINGand leave the field unchanged.lifecyclestrings are silently ignored without a warning, matching the implementation's actual behavior (only type mismatches log).This piggybacks on the existing
RNSentryAndroidTesterGradle module and follows the conventions of the neighboringRNSentryStartTest.kt(JUnit4 + Mockito +JavaOnlyMap.of(...)fixtures + realSentryAndroidOptions()instances).Note on scope: the issue mentioned considering pinning
_experiments.enableUnhandledCPPExceptionsV2on Android too. That option is@platform iosonly (seepackages/core/src/js/options.ts:361) and is not handled on Android by design — there's nothing to pin. Skipped.💡 Motivation and Context
Closes #6016. The iOS bug fixed in #6012 (
_experiments.profilingOptionssilently ignored since v8.0.0) shipped because no test exercised the live init path's profiling wiring. The Android wiring is correct today, but it has no JUnit coverage either — so a future refactor movingconfigureAndroidProfilingout ofgetSentryAndroidOptions(or introducing a parallel init path the way the iOS one slipped in) would silently regress the same way. These tests close that gap with the same shape of coverage that pins the iOS path.💚 How did you test it?
./gradlew :app:testDebugUnitTest --tests "io.sentry.react.RNSentryProfilingOptionsTest"— 11/11 pass../gradlew :app:testDebugUnitTest— full Android test suite still green.yarn lint:android,yarn lint:kotlin,yarn build,yarn test,yarn circularDepCheck— all clean.options.set…calls insideconfigureAndroidProfilingcauses the "all three fields propagate" test to fail. Removing theconfigureAndroidProfiling(...)call site causes all 11 tests to fail.📝 Checklist
sendDefaultPIIis enabled🔮 Next steps