fix(android): Declare test-snapshots as task output for cache compatibility#5396
Open
runningcode wants to merge 2 commits intomainfrom
Open
fix(android): Declare test-snapshots as task output for cache compatibility#5396runningcode wants to merge 2 commits intomainfrom
runningcode wants to merge 2 commits intomainfrom
Conversation
…bility The screenshot snapshot PNGs written by ScreenshotEventProcessorTest are not declared as outputs of testDebugUnitTest. When the task result comes from the Gradle remote cache, the test code never runs and the directory is never created, so sentry-cli finds an empty folder and uploads nothing. Declaring the directory as a task output ensures Gradle caches and restores the snapshots on cache hits. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2680da7 to
8020d35
Compare
📲 Install BuildsAndroid
|
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5865051 | 319.74 ms | 365.60 ms | 45.86 ms |
| 0220a5c | 452.20 ms | 479.33 ms | 27.12 ms |
| 2124a46 | 319.19 ms | 415.04 ms | 95.85 ms |
| 2195398 | 322.52 ms | 361.91 ms | 39.39 ms |
| bbc35bb | 298.53 ms | 372.17 ms | 73.64 ms |
| d364ace | 382.77 ms | 443.21 ms | 60.44 ms |
| d15471f | 379.40 ms | 470.76 ms | 91.36 ms |
| 9139b91 | 351.35 ms | 355.63 ms | 4.28 ms |
| fc5ccaf | 322.49 ms | 405.25 ms | 82.76 ms |
| 52feca7 | 314.77 ms | 378.67 ms | 63.90 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5865051 | 0 B | 0 B | 0 B |
| 0220a5c | 0 B | 0 B | 0 B |
| 2124a46 | 1.58 MiB | 2.12 MiB | 551.51 KiB |
| 2195398 | 0 B | 0 B | 0 B |
| bbc35bb | 1.58 MiB | 2.12 MiB | 553.01 KiB |
| d364ace | 1.58 MiB | 2.11 MiB | 539.75 KiB |
| d15471f | 1.58 MiB | 2.13 MiB | 559.54 KiB |
| 9139b91 | 1.58 MiB | 2.13 MiB | 559.52 KiB |
| fc5ccaf | 1.58 MiB | 2.13 MiB | 557.54 KiB |
| 52feca7 | 0 B | 0 B | 0 B |
0xadam-brown
approved these changes
May 8, 2026
|
|
||
| // Snapshot PNGs are written by ScreenshotEventProcessorTest at runtime but must be declared as | ||
| // outputs so Gradle's build cache restores them on cache hits (otherwise the CLI upload step | ||
| // finds an empty directory). |
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.
Some PRs are failing when the gradle task that generates the snapshots comes from the cache because the snapshots are not pulled from the cache. This adjust it so that the snapshots are stored in the cache so they are successfully retrieved and then uploaded to sentry.
Summary
ScreenshotEventProcessorTestare not declared as outputs oftestDebugUnitTest. When the task result comes from the Gradle remote cache, the test code never runs and thebuild/test-snapshots/directory is never created, sosentry-clifinds an empty folder and uploads nothing.build/test-snapshots/as a task output so Gradle caches and restores the snapshots on cache hits.#skip-changelog
🤖 Generated with Claude Code