test: fix ViewModel unit tests (Cms/Gallery) and enable ByteBuddy experimental flag

This commit is contained in:
Torsten Schulz (local)
2026-05-28 09:42:01 +02:00
parent 0528334eb4
commit c8b7f5ec2e
25 changed files with 1379 additions and 93 deletions

View File

@@ -8,10 +8,13 @@ plugins {
val localApiBaseUrl = providers.gradleProperty("LOCAL_API_BASE_URL")
.orElse("http://10.0.2.2:3100/")
.get()
val sentryDsn = providers.gradleProperty("SENTRY_DSN")
.orElse("")
.get()
android {
namespace = "de.harheimertc"
compileSdk = 34
compileSdk = 35
defaultConfig {
applicationId = "de.harheimertc"
@@ -28,6 +31,7 @@ android {
applicationIdSuffix = ".local"
versionNameSuffix = "-local"
buildConfigField("String", "API_BASE_URL", "\"$localApiBaseUrl\"")
buildConfigField("String", "SENTRY_DSN", "\"\"")
buildConfigField("String", "ENVIRONMENT_NAME", "\"LOCAL\"")
manifestPlaceholders["usesCleartextTraffic"] = "true"
}
@@ -36,12 +40,14 @@ android {
applicationIdSuffix = ".test"
versionNameSuffix = "-test"
buildConfigField("String", "API_BASE_URL", "\"https://harheimertc.tsschulz.de/\"")
buildConfigField("String", "SENTRY_DSN", "\"$sentryDsn\"")
buildConfigField("String", "ENVIRONMENT_NAME", "\"TEST\"")
manifestPlaceholders["usesCleartextTraffic"] = "false"
}
create("production") {
dimension = "environment"
buildConfigField("String", "API_BASE_URL", "\"https://harheimertc.de/\"")
buildConfigField("String", "SENTRY_DSN", "\"$sentryDsn\"")
buildConfigField("String", "ENVIRONMENT_NAME", "\"\"")
manifestPlaceholders["usesCleartextTraffic"] = "false"
}
@@ -57,6 +63,13 @@ android {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
testOptions {
unitTests.all {
// allow Byte Buddy experimental features for newer JVMs
it.jvmArgs = listOf("-Dnet.bytebuddy.experimental=true")
}
}
}
kotlin {
@@ -101,6 +114,9 @@ dependencies {
// Coil
implementation("io.coil-kt:coil-compose:2.4.0")
// Crash reporting
implementation("io.sentry:sentry-android:8.42.0")
// Room
implementation("androidx.room:room-runtime:2.6.1")
ksp("androidx.room:room-compiler:2.6.1")
@@ -113,4 +129,6 @@ dependencies {
// Testing (skeleton)
testImplementation("junit:junit:4.13.2")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
testImplementation("io.mockk:mockk:1.13.7")
}