fix(android): прогонять unit-тесты только на debug-варианте
Тестовая активность Compose (androidx.activity.ComponentActivity) объявляется зависимостью ui-test-manifest, подключённой как debugImplementation, поэтому в release-манифесте её нет и createComposeRule падает на testReleaseUnitTest. Источники тестов вариант-агностичны, поэтому прогон один раз на debug даёт то же покрытие и не тащит тестовую активность в production-манифест.
This commit is contained in:
@@ -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 {
|
||||
implementation(libs.androidx.core.ktx)
|
||||
implementation(libs.androidx.activity.compose)
|
||||
|
||||
Reference in New Issue
Block a user