Skip to content

test(android): Speed up Robolectric tests in CI - #6543

Closed
romtsn wants to merge 1 commit into
mainfrom
romtsn/robolectric-ci
Closed

romtsn wants to merge 1 commit into
mainfrom
romtsn/robolectric-ci

Conversation

@romtsn

@romtsn romtsn commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (Robolectric CI)


📜 Description

Collection branch for the Robolectric CI speed-up stack. The stack PRs are merge-committed into this branch, and this branch is squash-merged into main at the end.

💡 Motivation and Context

A follow-up to #6470. That PR split the Robolectric tests from the plain JVM tests, but the gain came mostly from maxParallelForks. The plain JVM tests take only ~6% of the sentry-android-core unit-test time.

Local measurements showed two real costs:

  1. Each SDK level that a test JVM uses costs ~1.3s locally, the first time it is used in that fork. Core and replay used 11 levels.
  2. Robolectric downloads the android-all-instrumented jars at test runtime into ~/.m2. setup-gradle does not cache that directory, so CI downloads 100-200 MB per SDK level on each run.

Custom @Config(shadows = ...) sets do not make a new sandbox in Robolectric 4.15. Shadows of android.* classes are removed from the instrumentation config, because those packages are already instrumented. Sharing the shadows gave no gain, so it is not part of this stack.

💚 How did you test it?

See #6544 and #6545.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

Compare the CI test times of #6544 and #6545 with main.

🤖 Generated with Claude Code

#skip-changelog

@sentry

sentry Bot commented Nov 10, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.63.0 (1) release

⚙️ sentry-android Build Distribution Settings

@romtsn

romtsn commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Dropping the stack: #6545 is closed and #6544 now targets main directly.

@romtsn romtsn closed this Nov 11, 2026
@romtsn
romtsn deleted the romtsn/robolectric-ci branch November 11, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant