From 99aa5e5111b361d7d1c396af58bc5669144ae2c0 Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Fri, 21 Jun 2024 13:32:15 +0200 Subject: [PATCH 01/22] As a developer I want to be able to run the UI tests in the CI environment #242 --- .github/workflows/build.yml | 8 ++++++-- app/build.gradle | 20 +++++-------------- .../broccoli/CRUDIntegrationTest.java | 5 ++--- .../FilteringAndSearchingIntegrationTest.java | 5 ++--- .../broccoli/ImportingIntegrationTest.java | 6 +++--- .../broccoli/SeasonsIntegrationTest.java | 4 ++-- gradle.properties | 1 - 7 files changed, 20 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8ad6197e..cc13dab2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,8 @@ on: jobs: test: - name: Run Unit Tests + name: Run Tests + if: ${{ !contains(github.ref, 'l10n_master') }} runs-on: ubuntu-latest steps: @@ -18,9 +19,12 @@ jobs: distribution: 'temurin' java-version: 17 - - name: Unit Tests + - name: Run Unit Tests run: bash ./gradlew test -Pbase64EncodedPublicKey=${{secrets.PUBLIC_KEY}} --stacktrace + - name: Run UI Tests + run: bash ./gradlew allDevicesCheck + apk: name: Generate APK runs-on: ubuntu-latest diff --git a/app/build.gradle b/app/build.gradle index 73055340..09ce5c96 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,6 +17,7 @@ android { versionCode 1021000 // versionMajor * 1000000 + versionMinor * 10000 + versionPatch * 100 + versionBuild versionName "1.2.10" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + testInstrumentationRunnerArgument "notAnnotation", "androidx.test.filters.FlakyTest" javaCompileOptions { annotationProcessorOptions { arguments = ["room.schemaLocation": @@ -58,21 +59,10 @@ android { animationsDisabled = true managedDevices { devices { - pixel2api31(ManagedVirtualDevice) { - device = "Pixel 2" - apiLevel = 31 - systemImageSource = "aosp" - } - nexus9api26(ManagedVirtualDevice) { - device = "Nexus 9" - apiLevel = 26 - systemImageSource = "aosp" - } - } - groups { - phoneAndTablet { - targetDevices.add(devices.pixel2api31) - targetDevices.add(devices.nexus9api26) + pixel8api34(ManagedVirtualDevice) { + device = "Pixel 8" + apiLevel = 34 + systemImageSource = "aosp-atd" } } } diff --git a/app/src/androidTest/java/com/flauschcode/broccoli/CRUDIntegrationTest.java b/app/src/androidTest/java/com/flauschcode/broccoli/CRUDIntegrationTest.java index a3b470b0..ffe83d26 100644 --- a/app/src/androidTest/java/com/flauschcode/broccoli/CRUDIntegrationTest.java +++ b/app/src/androidTest/java/com/flauschcode/broccoli/CRUDIntegrationTest.java @@ -4,7 +4,6 @@ import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.Espresso.pressBack; -import static androidx.test.espresso.action.ViewActions.clearText; import static androidx.test.espresso.action.ViewActions.click; import static androidx.test.espresso.action.ViewActions.replaceText; import static androidx.test.espresso.action.ViewActions.typeText; @@ -18,7 +17,7 @@ import androidx.test.espresso.accessibility.AccessibilityChecks; import androidx.test.espresso.matcher.ViewMatchers; import androidx.test.ext.junit.runners.AndroidJUnit4; -import androidx.test.filters.LargeTest; +import androidx.test.filters.FlakyTest; import com.flauschcode.broccoli.util.RecyclerViewAssertions; import com.flauschcode.broccoli.util.RecyclerViewMatcher; @@ -29,7 +28,7 @@ import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) -@LargeTest +@FlakyTest public class CRUDIntegrationTest { private ActivityScenario scenario; diff --git a/app/src/androidTest/java/com/flauschcode/broccoli/FilteringAndSearchingIntegrationTest.java b/app/src/androidTest/java/com/flauschcode/broccoli/FilteringAndSearchingIntegrationTest.java index 63d6aca2..1b6dfd10 100644 --- a/app/src/androidTest/java/com/flauschcode/broccoli/FilteringAndSearchingIntegrationTest.java +++ b/app/src/androidTest/java/com/flauschcode/broccoli/FilteringAndSearchingIntegrationTest.java @@ -19,7 +19,6 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; -import static com.flauschcode.broccoli.util.CustomViewActions.waitFor; import static com.flauschcode.broccoli.util.CustomViewActions.waitForView; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.instanceOf; @@ -35,7 +34,7 @@ import androidx.test.espresso.accessibility.AccessibilityChecks; import androidx.test.espresso.matcher.ViewMatchers; import androidx.test.ext.junit.runners.AndroidJUnit4; -import androidx.test.filters.LargeTest; +import androidx.test.filters.FlakyTest; import com.flauschcode.broccoli.category.Category; import com.flauschcode.broccoli.util.RecyclerViewAssertions; @@ -50,7 +49,7 @@ import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) -@LargeTest +@FlakyTest public class FilteringAndSearchingIntegrationTest { private ActivityScenario scenario; diff --git a/app/src/androidTest/java/com/flauschcode/broccoli/ImportingIntegrationTest.java b/app/src/androidTest/java/com/flauschcode/broccoli/ImportingIntegrationTest.java index 9ac6caf2..11c21b9c 100644 --- a/app/src/androidTest/java/com/flauschcode/broccoli/ImportingIntegrationTest.java +++ b/app/src/androidTest/java/com/flauschcode/broccoli/ImportingIntegrationTest.java @@ -16,7 +16,7 @@ import androidx.test.espresso.accessibility.AccessibilityChecks; import androidx.test.espresso.matcher.ViewMatchers; import androidx.test.ext.junit.runners.AndroidJUnit4; -import androidx.test.filters.LargeTest; +import androidx.test.filters.FlakyTest; import com.flauschcode.broccoli.recipe.crud.CreateAndEditRecipeActivity; @@ -38,7 +38,7 @@ */ @RunWith(AndroidJUnit4.class) -@LargeTest +@FlakyTest public class ImportingIntegrationTest { private ActivityScenario scenario; @@ -104,7 +104,7 @@ public void import_new_recipe_with_arrified_json() { onView(withId(R.id.new_preparation_time)).check(matches(withText("25m"))); onView(withId(R.id.new_description)).check(matches(withSubstring("Dieses Grundrezept für Fladenbrot ohne Hefe passt zu vielen Gerichten. Das einfache und schnelle Rezept ist sehr variabel."))); onView(withId(R.id.new_ingredients)).check(matches(withText("200 g Mehl, Type 550\n3 EL Olivenöl (oder Pflanzenöl)\n3 EL Olivenöl (oder Pflanzenöl)\n1 Prise Salz\n100 ml Wasser"))); - onView(withId(R.id.new_directions)).check(matches(withText("Zuerst das Mehl in eine Schüssel geben, Salz, Wasser und Olivenöl dazugeben und alle Zutaten zu einem Teig verkneten - am besten mit der Hand.\nDann den Teig für 10 Minuten quellen lassen und erneut für 5 Minuten kneten, so dass ein glatter Teig entsteht.\nSpäter aus dem Teig 4 dünne Fladen formen, eine gusseiserne Pfanne (=unbeschichtet) ohne Fett erhitzen und die Teigfladen darin nacheinander backen bis sich die ersten braunen Flecken zeigen.\nIm Anschluss die Fladen wenden und auch auf der anderen Seite backen."))); + onView(withId(R.id.new_directions)).check(matches(withText("1. Zuerst das Mehl in eine Schüssel geben, Salz, Wasser und Olivenöl dazugeben und alle Zutaten zu einem Teig verkneten - am besten mit der Hand.\n2. Dann den Teig für 10 Minuten quellen lassen und erneut für 5 Minuten kneten, so dass ein glatter Teig entsteht.\n3. Später aus dem Teig 4 dünne Fladen formen, eine gusseiserne Pfanne (=unbeschichtet) ohne Fett erhitzen und die Teigfladen darin nacheinander backen bis sich die ersten braunen Flecken zeigen.\n4. Im Anschluss die Fladen wenden und auch auf der anderen Seite backen."))); } @Test diff --git a/app/src/androidTest/java/com/flauschcode/broccoli/SeasonsIntegrationTest.java b/app/src/androidTest/java/com/flauschcode/broccoli/SeasonsIntegrationTest.java index 3e2c43d6..e64e96f2 100644 --- a/app/src/androidTest/java/com/flauschcode/broccoli/SeasonsIntegrationTest.java +++ b/app/src/androidTest/java/com/flauschcode/broccoli/SeasonsIntegrationTest.java @@ -33,7 +33,7 @@ import androidx.test.espresso.accessibility.AccessibilityChecks; import androidx.test.espresso.matcher.ViewMatchers; import androidx.test.ext.junit.runners.AndroidJUnit4; -import androidx.test.filters.LargeTest; +import androidx.test.filters.FlakyTest; import com.flauschcode.broccoli.util.RecyclerViewAssertions; import com.flauschcode.broccoli.util.RecyclerViewMatcher; @@ -49,7 +49,7 @@ import java.util.Set; @RunWith(AndroidJUnit4.class) -@LargeTest +@FlakyTest public class SeasonsIntegrationTest { private ActivityScenario scenario; diff --git a/gradle.properties b/gradle.properties index 54e94c6d..159e4f66 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,6 +16,5 @@ org.gradle.jvmargs=-Xmx1536m # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true -android.experimental.testOptions.managedDevices.allowOldApiLevelDevices=true org.gradle.configuration-cache=true From e86a660a56ab52f3e119bf3451236cd146352b13 Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Fri, 21 Jun 2024 14:28:50 +0200 Subject: [PATCH 02/22] As a developer I want to be able to run the UI tests in the CI environment #242 Changed runner to macos-latest. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc13dab2..3117878d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ jobs: test: name: Run Tests if: ${{ !contains(github.ref, 'l10n_master') }} - runs-on: ubuntu-latest + runs-on: macos-latest steps: - name: Check Out Repository From 965133b207860c3f65fdc2eb7ff547243c7fc007 Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Fri, 21 Jun 2024 14:48:52 +0200 Subject: [PATCH 03/22] As a developer I want to be able to run the UI tests in the CI environment #242 Downgraded api level for device. --- .github/workflows/build.yml | 21 ++++----------------- app/build.gradle | 2 +- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3117878d..b513f7c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,6 @@ on: jobs: test: name: Run Tests - if: ${{ !contains(github.ref, 'l10n_master') }} runs-on: macos-latest steps: @@ -20,27 +19,15 @@ jobs: java-version: 17 - name: Run Unit Tests - run: bash ./gradlew test -Pbase64EncodedPublicKey=${{secrets.PUBLIC_KEY}} --stacktrace + if: ${{ !contains(github.ref, 'l10n_master') }} + run: bash ./gradlew test - name: Run UI Tests + if: ${{ !contains(github.ref, 'l10n_master') }} run: bash ./gradlew allDevicesCheck - apk: - name: Generate APK - runs-on: ubuntu-latest - - steps: - - name: Check Out Repository - uses: actions/checkout@v4 - - - name: Set Up Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 17 - - name: Assemble App Debug APK - run: ./gradlew assembleDebug -Pbase64EncodedPublicKey=${{secrets.PUBLIC_KEY}} --stacktrace + run: ./gradlew assembleDebug - name: Upload App Play APK uses: actions/upload-artifact@v4 diff --git a/app/build.gradle b/app/build.gradle index 09ce5c96..315dd68c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -61,7 +61,7 @@ android { devices { pixel8api34(ManagedVirtualDevice) { device = "Pixel 8" - apiLevel = 34 + apiLevel = 33 systemImageSource = "aosp-atd" } } From dfc7144c3195b70255242512bdad182ecfaba10d Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Fri, 21 Jun 2024 14:54:07 +0200 Subject: [PATCH 04/22] As a developer I want to be able to run the UI tests in the CI environment #242 Downgraded api level for device. --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 315dd68c..267cab15 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -61,7 +61,7 @@ android { devices { pixel8api34(ManagedVirtualDevice) { device = "Pixel 8" - apiLevel = 33 + apiLevel = 30 systemImageSource = "aosp-atd" } } From 60b3158f4f217bd5ee9a5b26a3b51e32f286cd4a Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Fri, 21 Jun 2024 15:10:02 +0200 Subject: [PATCH 05/22] As a developer I want to be able to run the UI tests in the CI environment #242 Testing stuff. --- app/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 267cab15..810619d8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -60,9 +60,10 @@ android { managedDevices { devices { pixel8api34(ManagedVirtualDevice) { - device = "Pixel 8" + device = "Pixel 2" apiLevel = 30 systemImageSource = "aosp-atd" + require64Bit = true } } } From 35f172a709646bf22c4c5965e04193dc41f36a33 Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Fri, 21 Jun 2024 15:23:10 +0200 Subject: [PATCH 06/22] As a developer I want to be able to run the UI tests in the CI environment #242 Testing stuff. --- app/build.gradle | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 810619d8..93ccf8ee 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -61,9 +61,8 @@ android { devices { pixel8api34(ManagedVirtualDevice) { device = "Pixel 2" - apiLevel = 30 - systemImageSource = "aosp-atd" - require64Bit = true + apiLevel = 34 + systemImageSource = "google" } } } From 3fd5bc48bfa58872dee3dabce5f065b2922b050c Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Fri, 21 Jun 2024 15:43:02 +0200 Subject: [PATCH 07/22] As a developer I want to be able to run the UI tests in the CI environment #242 Testing stuff. --- .github/workflows/build.yml | 2 +- app/build.gradle | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b513f7c9..1d39ca60 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: - name: Run UI Tests if: ${{ !contains(github.ref, 'l10n_master') }} - run: bash ./gradlew allDevicesCheck + run: bash ./gradlew allDevicesFdroidDebugAndroidTest - name: Assemble App Debug APK run: ./gradlew assembleDebug diff --git a/app/build.gradle b/app/build.gradle index 93ccf8ee..0433de8d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -58,11 +58,11 @@ android { testOptions { animationsDisabled = true managedDevices { - devices { - pixel8api34(ManagedVirtualDevice) { + localDevices { + pixel2api30 { device = "Pixel 2" - apiLevel = 34 - systemImageSource = "google" + apiLevel = 30 + systemImageSource = "aosp-atd" } } } From 731533249affc7b8ab582d69d9ad2f938d5b1d7c Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Fri, 21 Jun 2024 15:57:53 +0200 Subject: [PATCH 08/22] As a developer I want to be able to run the UI tests in the CI environment #242 Accept licenses. --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d39ca60..2deb50f0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,10 @@ jobs: if: ${{ !contains(github.ref, 'l10n_master') }} run: bash ./gradlew test + - name: Accept Licenses + if: ${{ !contains(github.ref, 'l10n_master') }} + run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses || true + - name: Run UI Tests if: ${{ !contains(github.ref, 'l10n_master') }} run: bash ./gradlew allDevicesFdroidDebugAndroidTest From 5c4cd75a0e16508132d5f5d3925f32f79a29b40f Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Fri, 21 Jun 2024 16:12:46 +0200 Subject: [PATCH 09/22] As a developer I want to be able to run the UI tests in the CI environment #242 Testing stuff. --- app/build.gradle | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0433de8d..428b925f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -59,10 +59,11 @@ android { animationsDisabled = true managedDevices { localDevices { - pixel2api30 { + pixel2api34 { device = "Pixel 2" - apiLevel = 30 + apiLevel = 34 systemImageSource = "aosp-atd" + require64Bit = true } } } From 389ca204a6102b128747516ddda024c57157f605 Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Fri, 21 Jun 2024 16:27:59 +0200 Subject: [PATCH 10/22] As a developer I want to be able to run the UI tests in the CI environment #242 Testing stuff. --- app/build.gradle | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 428b925f..bddf3fac 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -61,9 +61,8 @@ android { localDevices { pixel2api34 { device = "Pixel 2" - apiLevel = 34 + apiLevel = 33 systemImageSource = "aosp-atd" - require64Bit = true } } } From 09d4f8024c4a38c417de8a7a58f298cf083172d4 Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Fri, 21 Jun 2024 16:32:00 +0200 Subject: [PATCH 11/22] As a developer I want to be able to run the UI tests in the CI environment #242 Testing stuff. --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index bddf3fac..5bb5b870 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -61,7 +61,7 @@ android { localDevices { pixel2api34 { device = "Pixel 2" - apiLevel = 33 + apiLevel = 32 systemImageSource = "aosp-atd" } } From 1ced05c33d33a162d38540054661f75c8ec46169 Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Fri, 21 Jun 2024 16:35:57 +0200 Subject: [PATCH 12/22] As a developer I want to be able to run the UI tests in the CI environment #242 Testing stuff. --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5bb5b870..d22aabbd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -59,9 +59,9 @@ android { animationsDisabled = true managedDevices { localDevices { - pixel2api34 { + pixel2api31 { device = "Pixel 2" - apiLevel = 32 + apiLevel = 31 systemImageSource = "aosp-atd" } } From 296a5f60e4eaa267daf2f00cd272aa5ea568bade Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Fri, 21 Jun 2024 16:40:32 +0200 Subject: [PATCH 13/22] As a developer I want to be able to run the UI tests in the CI environment #242 Testing stuff. --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index d22aabbd..25bfa861 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -61,7 +61,7 @@ android { localDevices { pixel2api31 { device = "Pixel 2" - apiLevel = 31 + apiLevel = 30 systemImageSource = "aosp-atd" } } From 3a23d2ce20ce15d731bef9526bc5b641bee5982c Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Fri, 21 Jun 2024 16:52:31 +0200 Subject: [PATCH 14/22] As a developer I want to be able to run the UI tests in the CI environment #242 Testing stuff. --- .github/workflows/build.yml | 3 +-- app/build.gradle | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2deb50f0..e1604b80 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,6 @@ on: jobs: test: - name: Run Tests runs-on: macos-latest steps: @@ -28,7 +27,7 @@ jobs: - name: Run UI Tests if: ${{ !contains(github.ref, 'l10n_master') }} - run: bash ./gradlew allDevicesFdroidDebugAndroidTest + run: bash ./gradlew allDevicesFdroidDebugAndroidTest -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true - name: Assemble App Debug APK run: ./gradlew assembleDebug diff --git a/app/build.gradle b/app/build.gradle index 25bfa861..0433de8d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -59,7 +59,7 @@ android { animationsDisabled = true managedDevices { localDevices { - pixel2api31 { + pixel2api30 { device = "Pixel 2" apiLevel = 30 systemImageSource = "aosp-atd" From 5aaeea59f8f02a12e985069dff5e0fc73eb62110 Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Fri, 21 Jun 2024 16:59:05 +0200 Subject: [PATCH 15/22] As a developer I want to be able to run the UI tests in the CI environment #242 Testing stuff. --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1604b80..c47fd595 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,8 @@ on: push jobs: - test: + build: + name: Test & Build runs-on: macos-latest steps: From 39880f480385616cb7e448cfc2045c133ae60255 Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Fri, 21 Jun 2024 17:12:49 +0200 Subject: [PATCH 16/22] As a developer I want to be able to run the UI tests in the CI environment #242 Testing stuff. --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c47fd595..a8b273f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,7 @@ on: jobs: build: name: Test & Build - runs-on: macos-latest + runs-on: macos-latest-large steps: - name: Check Out Repository @@ -28,7 +28,7 @@ jobs: - name: Run UI Tests if: ${{ !contains(github.ref, 'l10n_master') }} - run: bash ./gradlew allDevicesFdroidDebugAndroidTest -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true + run: bash ./gradlew allDevicesFdroidDebugAndroidTest - name: Assemble App Debug APK run: ./gradlew assembleDebug From 8e39f91b9f1cb6d3c3feb36bb6b5a451124760ac Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Mon, 9 Dec 2024 10:08:09 +0100 Subject: [PATCH 17/22] As a developer I want to be able to run the UI tests in the CI environment #242 Removed unnecessary imports. --- app/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 0433de8d..0f255436 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,4 +1,3 @@ -import com.android.build.api.dsl.ManagedVirtualDevice import com.android.tools.profgen.ArtProfileKt import com.android.tools.profgen.ArtProfileSerializer import com.android.tools.profgen.DexFile From 561802ea1b3eb0775b4f1f15063fec0f1d919312 Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Mon, 9 Dec 2024 10:20:33 +0100 Subject: [PATCH 18/22] As a developer I want to be able to run the UI tests in the CI environment #242 macos-latest-large is only available for paid plans. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8b273f3..a6a67001 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,7 @@ on: jobs: build: name: Test & Build - runs-on: macos-latest-large + runs-on: ubuntu-latest steps: - name: Check Out Repository From 513679438a3d3056cb7aeadc6aa00dcc448a11f8 Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Mon, 9 Dec 2024 10:41:45 +0100 Subject: [PATCH 19/22] As a developer I want to be able to run the UI tests in the CI environment #242 Changed back to macos-latest runner. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a6a67001..94b1f897 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,7 @@ on: jobs: build: name: Test & Build - runs-on: ubuntu-latest + runs-on: macos-latest steps: - name: Check Out Repository From f5d1c017494346537ad71276a7e519951b6f6177 Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Mon, 9 Dec 2024 10:50:34 +0100 Subject: [PATCH 20/22] As a developer I want to be able to run the UI tests in the CI environment #242 Changed to ubuntu runner with KVM enabled. --- .github/workflows/build.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94b1f897..491bd575 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,9 +6,17 @@ on: jobs: build: name: Test & Build - runs-on: macos-latest + runs-on: ubuntu-latest + timeout-minutes: 120 steps: + - name: Enable KVM group perms + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + ls /dev/kvm + - name: Check Out Repository uses: actions/checkout@v4 @@ -28,7 +36,7 @@ jobs: - name: Run UI Tests if: ${{ !contains(github.ref, 'l10n_master') }} - run: bash ./gradlew allDevicesFdroidDebugAndroidTest + run: bash ./gradlew allDevicesFdroidDebugAndroidTest -Pandroid.testoptions.manageddevices.emulator.gpu=swiftshader_indirect -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true -Pandroid.experimental.testOptions.managedDevices.maxConcurrentDevices=1 -Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=180 - name: Assemble App Debug APK run: ./gradlew assembleDebug From a2edb8bfbeb61f5ae6dca7968ff49a42dd83dd35 Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Mon, 9 Dec 2024 11:15:15 +0100 Subject: [PATCH 21/22] As a developer I want to be able to run the UI tests in the CI environment #242 Upload test results as artifacts. --- .github/workflows/build.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 491bd575..ece3f4e5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,6 @@ jobs: build: name: Test & Build runs-on: ubuntu-latest - timeout-minutes: 120 steps: - name: Enable KVM group perms @@ -28,7 +27,14 @@ jobs: - name: Run Unit Tests if: ${{ !contains(github.ref, 'l10n_master') }} - run: bash ./gradlew test + run: bash ./gradlew testFdroidDebugUnitTest + + - name: Upload Unit Tests Results + if: ${{ !contains(github.ref, 'l10n_master') }} + uses: actions/upload-artifact@v4 + with: + name: unit-tests-results + path: app/build/reports/tests/testFdroidDebugUnitTest/index.html - name: Accept Licenses if: ${{ !contains(github.ref, 'l10n_master') }} @@ -38,6 +44,13 @@ jobs: if: ${{ !contains(github.ref, 'l10n_master') }} run: bash ./gradlew allDevicesFdroidDebugAndroidTest -Pandroid.testoptions.manageddevices.emulator.gpu=swiftshader_indirect -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true -Pandroid.experimental.testOptions.managedDevices.maxConcurrentDevices=1 -Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=180 + - name: Upload UI Tests Results + if: ${{ !contains(github.ref, 'l10n_master') }} + uses: actions/upload-artifact@v4 + with: + name: ui-tests-results + path: app/build/reports/androidTests/managedDevice/debug/flavors/fdroid/allDevices/index.html + - name: Assemble App Debug APK run: ./gradlew assembleDebug From c2afeacc0cf3b0d64c15a301f0c1c3f58d84e513 Mon Sep 17 00:00:00 2001 From: flauschtrud Date: Mon, 9 Dec 2024 11:31:56 +0100 Subject: [PATCH 22/22] As a developer I want to be able to run the UI tests in the CI environment #242 Removed test result artifacts since just the index.html is not very helpful. --- .github/workflows/build.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ece3f4e5..807a5da7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,13 +29,6 @@ jobs: if: ${{ !contains(github.ref, 'l10n_master') }} run: bash ./gradlew testFdroidDebugUnitTest - - name: Upload Unit Tests Results - if: ${{ !contains(github.ref, 'l10n_master') }} - uses: actions/upload-artifact@v4 - with: - name: unit-tests-results - path: app/build/reports/tests/testFdroidDebugUnitTest/index.html - - name: Accept Licenses if: ${{ !contains(github.ref, 'l10n_master') }} run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses || true @@ -44,13 +37,6 @@ jobs: if: ${{ !contains(github.ref, 'l10n_master') }} run: bash ./gradlew allDevicesFdroidDebugAndroidTest -Pandroid.testoptions.manageddevices.emulator.gpu=swiftshader_indirect -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true -Pandroid.experimental.testOptions.managedDevices.maxConcurrentDevices=1 -Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=180 - - name: Upload UI Tests Results - if: ${{ !contains(github.ref, 'l10n_master') }} - uses: actions/upload-artifact@v4 - with: - name: ui-tests-results - path: app/build/reports/androidTests/managedDevice/debug/flavors/fdroid/allDevices/index.html - - name: Assemble App Debug APK run: ./gradlew assembleDebug