Skip to content

build(replay): Spike AGP test suites for Compose versions - #6639

Draft
runningcode wants to merge 1 commit into
mainfrom
no/spike-agp-compose-test-suites
Draft

runningcode wants to merge 1 commit into
mainfrom
no/spike-agp-compose-test-suites

Conversation

@runningcode

Copy link
Copy Markdown
Contributor

Spike, do not merge. It checks whether AGP 9.5's incubating testOptions.customSuites can replace the composeUi112/composeUi113 build types that run the Session Replay tests against other Compose UI versions.

Result

It works locally. Both testReleaseComposeUi112JvmTestSuite and testReleaseComposeUi113JvmTestSuite run all 299 replay tests (1 skipped), with androidx.compose.ui:ui resolved to 1.12.1 and 1.13.0-rc01. The regular unit tests stay on 1.9.5. The suites are hooked into check here so that CI runs them.

What it took

  • android.experimental.testSuiteSupport=true.
  • Suite Kotlin compilation needs built-in Kotlin, so android.builtInKotlin=true and kotlin-android is removed from every Android module.
  • sentry-compose (KMP + com.android.library) is incompatible with built-in Kotlin. Its use in sentry-android-core and sentry-bom is commented out.
  • AGP checks that every Kotlin compile's JVM target equals compileOptions.targetCompatibility. Test code needs Java 11+ (Mockito 5), so the whole replay module, published code included, compiles at Java 21.
  • Five workarounds against the suite API:
    • Point the suite sources at src/test and extend testImplementation.
    • Force the android attributes onto the suite runtime classpath. Otherwise it resolves Compose's desktop/jvmstubs artifacts.
    • Add the mockable android.jar.
    • Add the suite's own processed Java resources.
    • Generate Robolectric's test_config.properties.
  • The JUnit vintage engine plus the Platform launcher as engine dependencies.

Still missing

  • Our Robolectric plugin only hooks regular unit tests, so the suites download their android-all jars during the run.
  • Without kotlin-android, the Android modules lose checkKotlinAbi/updateKotlinAbi, so their API dumps are no longer verified.

🤖 Generated with Claude Code

Not for merging. Runs the replay unit tests against Compose UI 1.12 and
1.13 as AGP 9.5 custom test suites instead of extra build types, to see
what it takes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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