-
-
Notifications
You must be signed in to change notification settings - Fork 357
test(e2e): Add auto init from JS tests for Android #5583
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
Open
antonis
wants to merge
7
commits into
antonis/capture-app-start-errors-v8
Choose a base branch
from
antonis/test-capture-app-start-errors-android
base: antonis/capture-app-start-errors-v8
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
test(e2e): Add auto init from JS tests for Android #5583
antonis
wants to merge
7
commits into
antonis/capture-app-start-errors-v8
from
antonis/test-capture-app-start-errors-android
+416
−2
Conversation
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
Implements Android E2E testing infrastructure to verify both manual native initialization and auto initialization from JavaScript, matching the iOS implementation and resolving issue #4912. Key additions: - Jest configs for android.auto and android.manual test modes - Build scripts that toggle SENTRY_DISABLE_NATIVE_START at compile time - Test scripts to run auto and manual test suites separately - App start crash testing via flag file mechanism - TestControlModule to enable/disable crash-on-start from JS - Comprehensive E2E test documentation Unlike iOS which uses launch arguments at runtime, Android requires separate builds with different build configurations to control native initialization. Closes #4912 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
Contributor
Android (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b4df5a0+dirty | 405.80 ms | 412.56 ms | 6.77 ms |
| 88812b1+dirty | 428.04 ms | 462.22 ms | 34.18 ms |
| 82de722+dirty | 425.13 ms | 457.02 ms | 31.89 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b4df5a0+dirty | 43.75 MiB | 48.40 MiB | 4.65 MiB |
| 88812b1+dirty | 43.75 MiB | 48.40 MiB | 4.64 MiB |
| 82de722+dirty | 43.75 MiB | 48.40 MiB | 4.64 MiB |
Previous results on branch: antonis/test-capture-app-start-errors-android
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 020ebf6+dirty | 448.91 ms | 477.16 ms | 28.25 ms |
| b31244e+dirty | 423.93 ms | 460.20 ms | 36.26 ms |
| 1943112+dirty | 408.73 ms | 430.33 ms | 21.60 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 020ebf6+dirty | 43.75 MiB | 48.40 MiB | 4.64 MiB |
| b31244e+dirty | 43.75 MiB | 48.40 MiB | 4.65 MiB |
| 1943112+dirty | 43.75 MiB | 48.40 MiB | 4.64 MiB |
Contributor
Android (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b4df5a0+dirty | 364.57 ms | 389.29 ms | 24.71 ms |
| 88812b1+dirty | 425.90 ms | 435.25 ms | 9.35 ms |
| 82de722+dirty | 398.52 ms | 422.70 ms | 24.18 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b4df5a0+dirty | 43.94 MiB | 49.22 MiB | 5.29 MiB |
| 88812b1+dirty | 43.94 MiB | 49.22 MiB | 5.29 MiB |
| 82de722+dirty | 43.94 MiB | 49.22 MiB | 5.29 MiB |
Previous results on branch: antonis/test-capture-app-start-errors-android
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 020ebf6+dirty | 403.26 ms | 440.21 ms | 36.95 ms |
| b31244e+dirty | 373.67 ms | 386.73 ms | 13.06 ms |
| 1943112+dirty | 537.14 ms | 566.29 ms | 29.15 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 020ebf6+dirty | 43.94 MiB | 49.22 MiB | 5.29 MiB |
| b31244e+dirty | 43.94 MiB | 49.22 MiB | 5.29 MiB |
| 1943112+dirty | 43.94 MiB | 49.22 MiB | 5.29 MiB |
Contributor
iOS (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 88812b1+dirty | 1216.63 ms | 1215.55 ms | -1.08 ms |
| 82de722+dirty | 1213.09 ms | 1208.90 ms | -4.19 ms |
| b4df5a0+dirty | 1213.04 ms | 1218.59 ms | 5.55 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 88812b1+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
| 82de722+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
| b4df5a0+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
Previous results on branch: antonis/test-capture-app-start-errors-android
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 1943112+dirty | 1210.58 ms | 1199.85 ms | -10.73 ms |
| 020ebf6+dirty | 1217.27 ms | 1213.35 ms | -3.92 ms |
| b31244e+dirty | 1214.33 ms | 1215.92 ms | 1.58 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 1943112+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
| 020ebf6+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
| b31244e+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
Contributor
iOS (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 88812b1+dirty | 1210.98 ms | 1215.22 ms | 4.24 ms |
| 82de722+dirty | 1210.87 ms | 1217.00 ms | 6.13 ms |
| b4df5a0+dirty | 1217.06 ms | 1221.61 ms | 4.55 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 88812b1+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
| 82de722+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
| b4df5a0+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
Previous results on branch: antonis/test-capture-app-start-errors-android
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 1943112+dirty | 1219.08 ms | 1223.48 ms | 4.40 ms |
| 020ebf6+dirty | 1214.02 ms | 1217.34 ms | 3.32 ms |
| b31244e+dirty | 1214.18 ms | 1214.19 ms | 0.01 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 1943112+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
| 020ebf6+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
| b31244e+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
The crash control buttons are off-screen, so the Maestro flow needs to scroll to find them before tapping. This matches the pattern used in other Android E2E tests. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The crash flag file was persisting across app launches, causing the app to crash indefinitely. Now the flag auto-deletes when read, allowing: 1. First launch: Enable flag 2. Second launch: Read flag, delete it, then crash 3. Third launch: Start normally and send crash report This solves the chicken-and-egg problem where the app couldn't reach JavaScript to clear the flag because it kept crashing before JS loaded. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Android wraps exceptions thrown in Application.onCreate() with: "Unable to create application... RuntimeException: <original message>" Updated the test to check if ANY exception in the chain contains our intentional crash message, rather than expecting an exact match on the first exception. Test now passes locally and should pass in CI. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…capture-app-start-errors-android
Contributor
Author
|
@sentry review |
…capture-app-start-errors-android
Contributor
Author
|
@sentry review |
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
Based on #5582
📜 Description
Implements Android E2E testing infrastructure to verify both manual native initialization and auto initialization from JavaScript, matching the iOS implementation and resolving issue #4912.
Key additions:
Unlike iOS which uses launch arguments at runtime, Android requires separate builds with different build configurations to control native initialization.
💡 Motivation and Context
Fixes #4912
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled🔮 Next steps
#skip-changelog