From a033be22b3d90c446b71def42fbb1987455071b1 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Fri, 8 May 2026 10:58:46 +0200 Subject: [PATCH 1/2] fix(build): Remove testBuildType mechanism from UI test modules The debug and release build types were configured identically in both uitest modules (same minification, proguard rules, signing). Disable the debug variant unconditionally, hardcode testBuildType to release, and combine the now-simplified Gradle invocations. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/agp-matrix.yml | 2 +- AGENTS.md | 2 +- Makefile | 6 ++---- .../build.gradle.kts | 18 ++++-------------- .../sentry-uitest-android/README.md | 6 ++---- .../sentry-uitest-android/build.gradle.kts | 13 ++++--------- 6 files changed, 14 insertions(+), 33 deletions(-) diff --git a/.github/workflows/agp-matrix.yml b/.github/workflows/agp-matrix.yml index 33ba8ae93e8..91bf1765f35 100644 --- a/.github/workflows/agp-matrix.yml +++ b/.github/workflows/agp-matrix.yml @@ -90,7 +90,7 @@ jobs: disable-spellchecker: true emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disk-size: 4096M - script: ./gradlew sentry-android-integration-tests:sentry-uitest-android:connectedReleaseAndroidTest -DtestBuildType=release -Denvironment=github --daemon + script: ./gradlew sentry-android-integration-tests:sentry-uitest-android:connectedReleaseAndroidTest -Denvironment=github --daemon - name: Upload test results if: always() diff --git a/AGENTS.md b/AGENTS.md index 42a8e651004..4985e33510c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -76,7 +76,7 @@ make systemTest ```bash # Assemble Android test APKs ./gradlew :sentry-android-integration-tests:sentry-uitest-android:assembleRelease -./gradlew :sentry-android-integration-tests:sentry-uitest-android:assembleAndroidTest -DtestBuildType=release +./gradlew :sentry-android-integration-tests:sentry-uitest-android:assembleAndroidTest # Run critical UI tests ./scripts/test-ui-critical.sh diff --git a/Makefile b/Makefile index 55f465a9663..c9eca8b8b7e 100644 --- a/Makefile +++ b/Makefile @@ -37,13 +37,11 @@ api: # Assemble release and Android test apk of the uitest-android-benchmark module assembleBenchmarkTestRelease: - ./gradlew :sentry-android-integration-tests:sentry-uitest-android-benchmark:assembleRelease - ./gradlew :sentry-android-integration-tests:sentry-uitest-android-benchmark:assembleAndroidTest -DtestBuildType=release + ./gradlew :sentry-android-integration-tests:sentry-uitest-android-benchmark:assembleRelease :sentry-android-integration-tests:sentry-uitest-android-benchmark:assembleAndroidTest # Assemble release and Android test apk of the uitest-android module assembleUiTestRelease: - ./gradlew :sentry-android-integration-tests:sentry-uitest-android:assembleRelease - ./gradlew :sentry-android-integration-tests:sentry-uitest-android:assembleAndroidTest -DtestBuildType=release + ./gradlew :sentry-android-integration-tests:sentry-uitest-android:assembleRelease :sentry-android-integration-tests:sentry-uitest-android:assembleAndroidTest # Assemble release of the uitest-android-critical module assembleUiTestCriticalRelease: diff --git a/sentry-android-integration-tests/sentry-uitest-android-benchmark/build.gradle.kts b/sentry-android-integration-tests/sentry-uitest-android-benchmark/build.gradle.kts index 4b5993644ee..459c1653fa9 100644 --- a/sentry-android-integration-tests/sentry-uitest-android-benchmark/build.gradle.kts +++ b/sentry-android-integration-tests/sentry-uitest-android-benchmark/build.gradle.kts @@ -46,21 +46,9 @@ android { } } - testBuildType = System.getProperty("testBuildType", "debug") + testBuildType = "release" buildTypes { - getByName("debug") { - isMinifyEnabled = true - signingConfig = signingConfigs.getByName("debug") - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "benchmark-proguard-rules.pro", - ) - testProguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "benchmark-proguard-rules.pro", - ) - } getByName("release") { isMinifyEnabled = true isShrinkResources = true @@ -89,7 +77,9 @@ android { } androidComponents.beforeVariants { - it.enable = !Config.Android.shouldSkipDebugVariant(it.buildType) + if (it.buildType == "debug") { + it.enable = false + } } } diff --git a/sentry-android-integration-tests/sentry-uitest-android/README.md b/sentry-android-integration-tests/sentry-uitest-android/README.md index c11397383d0..08389e0c16c 100644 --- a/sentry-android-integration-tests/sentry-uitest-android/README.md +++ b/sentry-android-integration-tests/sentry-uitest-android/README.md @@ -14,14 +14,12 @@ You can run benchmark tests only with `./gradlew :sentry-android-integration-tes To run on saucelabs execute following commands (need also `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` environment variables): For Benchmarks: ``` -./gradlew :sentry-android-integration-tests:sentry-uitest-android-benchmark:assembleRelease -./gradlew :sentry-android-integration-tests:sentry-uitest-android-benchmark:assembleAndroidTest -DtestBuildType=release +./gradlew :sentry-android-integration-tests:sentry-uitest-android-benchmark:assembleRelease :sentry-android-integration-tests:sentry-uitest-android-benchmark:assembleAndroidTest saucectl run -c .sauce/sentry-uitest-android-benchmark.yml ``` For End 2 End: ``` -./gradlew :sentry-android-integration-tests:sentry-uitest-android:assembleRelease -./gradlew :sentry-android-integration-tests:sentry-uitest-android:assembleAndroidTest -DtestBuildType=release +./gradlew :sentry-android-integration-tests:sentry-uitest-android:assembleRelease :sentry-android-integration-tests:sentry-uitest-android:assembleAndroidTest saucectl run -c .sauce/sentry-uitest-android-end2end.yml ``` diff --git a/sentry-android-integration-tests/sentry-uitest-android/build.gradle.kts b/sentry-android-integration-tests/sentry-uitest-android/build.gradle.kts index a4d46405fb8..5258a33f92a 100644 --- a/sentry-android-integration-tests/sentry-uitest-android/build.gradle.kts +++ b/sentry-android-integration-tests/sentry-uitest-android/build.gradle.kts @@ -51,18 +51,11 @@ android { } } - testBuildType = System.getProperty("testBuildType", "debug") + testBuildType = "release" buildTypes { - getByName("debug") { - isMinifyEnabled = true - signingConfig = signingConfigs.getByName("debug") - proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") - testProguardFiles("proguard-rules.pro") - } getByName("release") { isMinifyEnabled = true - isShrinkResources = false proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") signingConfig = signingConfigs.getByName("debug") // to be able to run release mode testProguardFiles("proguard-rules.pro") @@ -82,7 +75,9 @@ android { } androidComponents.beforeVariants { - it.enable = !Config.Android.shouldSkipDebugVariant(it.buildType) + if (it.buildType == "debug") { + it.enable = false + } } } From 94ab15f5430a32803e12bd98f8572762dd8a8f9d Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Fri, 8 May 2026 11:02:01 +0200 Subject: [PATCH 2/2] fix(build): Combine Gradle invocations in AGENTS.md Co-Authored-By: Claude Opus 4.6 --- AGENTS.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 4985e33510c..1784e4f950e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -75,8 +75,7 @@ make systemTest ### Android-Specific Commands ```bash # Assemble Android test APKs -./gradlew :sentry-android-integration-tests:sentry-uitest-android:assembleRelease -./gradlew :sentry-android-integration-tests:sentry-uitest-android:assembleAndroidTest +./gradlew :sentry-android-integration-tests:sentry-uitest-android:assembleRelease :sentry-android-integration-tests:sentry-uitest-android:assembleAndroidTest # Run critical UI tests ./scripts/test-ui-critical.sh