test(android): pin Robolectric tests to SDK 35 in robolectric.properties - #727
Merged
Merged
Conversation
A test class missing the per-class `@Config(sdk = [28])` defaults to compileSdk 36, which needs Java 21, so it passes locally and fails on CI. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/727")Built from d9e9454 |
SDK 28 was an arbitrary default. 35 is the newest SDK CI's JVM can run and covers code gated on newer APIs, closer to WordPress-Android's target of 36. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
dcalhoun
marked this pull request as ready for review
September 24, 2026 14:52
nbradbury
reviewed
Sep 24, 2026
| @@ -0,0 +1,2 @@ | |||
| # Robolectric otherwise defaults to compileSdk, which requires a newer JVM than CI runs. | |||
Contributor
There was a problem hiding this comment.
I'm not sure if this matters, but according to Claude:
The comment in robolectric.properties says Robolectric falls back to
compileSdk. It actually falls back to the manifest’s targetSdk, which happens to be 36 here. Only the wording is off.
nbradbury
approved these changes
Sep 24, 2026
nbradbury
left a comment
Contributor
There was a problem hiding this comment.
I left one nit but we're good to ![]()
Robolectric reads the manifest's targetSdk, not compileSdk; both are 36 today, which hid the difference. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
What?
Colocate Robolectric tests configuration. Bump to SDK 35.
Why?
Address feedback in #723 (comment). Avoid cryptic CI failures when tests pass locally.
How?
Pin Robolectric tests to SDK 35 in
robolectric.properties.Testing Instructions
N/A, no user-facing changes.
Accessibility Testing Instructions
N/A, no user-facing changes.
Screenshots or screencast
N/A, no user-facing changes.
AI-generated details
Problem: Follow-up to #723 review feedback. Each Robolectric test class pins
@Config(sdk = [28])individually. A new class that omits it defaults to the manifest's targetSdk (36), which needs Java 21, so it passes locally and fails on CI (asSvgIconCacheTestdid).Fix: Pin the SDK once in
android/Gutenberg/src/test/resources/robolectric.propertiesand drop the per-class SDK annotations. The pin also moves from the arbitrary 28 to 35, the newest SDK CI's JVM can run (36 needs Java 21), which is closer to WordPress-Android's target of 36 and covers code gated on newer APIs (e.g.BlockPickerDialog's Android 12+ branch). Test resources aren't packaged in the AAR, so consumers like WordPress-Android are unaffected.Testing: CI's
:android: Test Android Librarypasses, confirming CI's JVM supports SDK 35. Locally,make test-android-library-unit; temporarily settingsdk=9999in the properties file makes the suites fail withUnknownSdk, confirming Robolectric reads it.🤖 Generated with Claude Code