test infra: JUnit5 unit tests on Android modules + Compose UI test wiring
Add an architecture.android.unit.test convention plugin that runs local unit tests on the JUnit5 platform via useJUnitPlatform() (AndroidUnitTest extends Gradle's Test) + the unit-test bundle. Deliberately NOT using the de.mannodermaus plugin (targets AGP 8.x; we're on AGP 9). Add junit-platform-launcher (Gradle 9 dropped the bundled launcher); set the instrumentation runner; add a compose-ui-test bundle pinning espresso/runner to current versions (transitive espresso 3.5.0 calls the removed InputManager.getInstance() on API 34+). CI now runs ./gradlew test and compiles the instrumented tests. Drop unused testing catalog entries.
This commit is contained in:
@@ -2,6 +2,7 @@ plugins {
|
||||
alias(libs.plugins.architecture.android.library)
|
||||
alias(libs.plugins.architecture.koin)
|
||||
alias(libs.plugins.architecture.kotlinx.serialization)
|
||||
alias(libs.plugins.architecture.android.unit.test)
|
||||
}
|
||||
|
||||
android {
|
||||
@@ -12,4 +13,9 @@ dependencies {
|
||||
implementation(project(":core:domain"))
|
||||
implementation(project(":core:data"))
|
||||
implementation(project(":feature:characters:domain"))
|
||||
|
||||
// Swap a Ktor MockEngine into HttpClientFactory.create(...) for the repository test.
|
||||
testImplementation(libs.ktor.client.mock)
|
||||
testImplementation(libs.ktor.client.content.negotiation)
|
||||
testImplementation(libs.ktor.serialization.kotlinx.json)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user