fix(android): прогонять unit-тесты только на debug-варианте

Тестовая активность Compose (androidx.activity.ComponentActivity) объявляется
зависимостью ui-test-manifest, подключённой как debugImplementation, поэтому в
release-манифесте её нет и createComposeRule падает на testReleaseUnitTest.
Источники тестов вариант-агностичны, поэтому прогон один раз на debug даёт то
же покрытие и не тащит тестовую активность в production-манифест.
This commit is contained in:
iu
2026-10-16 12:48:08 +03:00
parent 3178699213
commit d0d6362a01
+11
View File
@@ -86,6 +86,17 @@ android {
} }
} }
// Unit tests run against the debug variant only. The Compose test activity comes
// from `ui-test-manifest`, a debug-only dependency, so the release variant's merged
// manifest has no activity for `createComposeRule` to launch. The test sources are
// variant-agnostic, so running them once (on debug) covers the same ground without
// shipping a test activity in the release manifest.
androidComponents {
beforeVariants(selector().withBuildType("release")) { variant ->
variant.enableUnitTest = false
}
}
dependencies { dependencies {
implementation(libs.androidx.core.ktx) implementation(libs.androidx.core.ktx)
implementation(libs.androidx.activity.compose) implementation(libs.androidx.activity.compose)