From 3fdebfff5f520e40d0ddde16b05ee3bcea2708b4 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Tue, 4 Feb 2025 19:47:04 +0000 Subject: [PATCH 1/4] dataconnect.yml: ensure that test logs are uploaded even when the tests fail --- .github/workflows/dataconnect.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dataconnect.yml b/.github/workflows/dataconnect.yml index 1049d031209..5aeae0aecef 100644 --- a/.github/workflows/dataconnect.yml +++ b/.github/workflows/dataconnect.yml @@ -175,7 +175,12 @@ jobs: ${{ env.FDC_FIREBASE_COMMAND }} emulators:start --only=auth >firebase.emulator.auth.log 2>&1 & - name: Gradle connectedCheck + id: connectedCheck uses: reactivecircus/android-emulator-runner@v2 + # Allow this GitHub Actions "job" to continue even if the tests fail so that logs from a + # failed test run get uploaded as "artifacts" and are available to investigate failed runs. + # A later step in this "job" will fail the job if this step fails + continue-on-error: true with: api-level: ${{ env.FDC_ANDROID_EMULATOR_API_LEVEL }} arch: x86_64 @@ -185,21 +190,28 @@ jobs: script: | set -eux && ./gradlew ${{ (inputs.gradleInfoLog && '--info') || '' }} :firebase-dataconnect:connectedCheck :firebase-dataconnect:connectors:connectedCheck - - uses: actions/upload-artifact@v4 - if: true + - name: Upload log file artifacts + uses: actions/upload-artifact@v4 with: name: logs path: "**/*.log" if-no-files-found: warn compression-level: 9 - - uses: actions/upload-artifact@v4 + - name: Upload Gradle build report artifacts + uses: actions/upload-artifact@v4 with: name: gradle_build_reports path: firebase-dataconnect/**/build/reports/ if-no-files-found: warn compression-level: 9 + - name: Check test result + if: steps.connectedCheck.outcome != 'success' + run: | + echo "Failing the job since the connectedCheck step failed" + exit 1 + # Check this yml file with "actionlint": https://github.com/rhysd/actionlint # To run actionlint yourself, run `brew install actionlint` followed by # `actionlint .github/workflows/dataconnect.yml` From d7f70972d7dc8b7048226b04b813072ff14ab47f Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Tue, 4 Feb 2025 21:16:10 +0000 Subject: [PATCH 2/4] dataconnect.yml: also capture adb logcat logs --- .github/workflows/dataconnect.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dataconnect.yml b/.github/workflows/dataconnect.yml index 5aeae0aecef..888ad061435 100644 --- a/.github/workflows/dataconnect.yml +++ b/.github/workflows/dataconnect.yml @@ -188,12 +188,12 @@ jobs: emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true script: | - set -eux && ./gradlew ${{ (inputs.gradleInfoLog && '--info') || '' }} :firebase-dataconnect:connectedCheck :firebase-dataconnect:connectors:connectedCheck + set -eux && adb logcat -c && ./gradlew ${{ (inputs.gradleInfoLog && '--info') || '' }} :firebase-dataconnect:connectedCheck :firebase-dataconnect:connectors:connectedCheck || (adb logcat -d >logcat.log) - name: Upload log file artifacts uses: actions/upload-artifact@v4 with: - name: logs + name: integration_test_logs path: "**/*.log" if-no-files-found: warn compression-level: 9 @@ -201,7 +201,7 @@ jobs: - name: Upload Gradle build report artifacts uses: actions/upload-artifact@v4 with: - name: gradle_build_reports + name: integration_test_gradle_build_reports path: firebase-dataconnect/**/build/reports/ if-no-files-found: warn compression-level: 9 From 43c2785275beb5fc34cc52e0a738f73102ab9514 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Wed, 5 Feb 2025 06:47:35 +0000 Subject: [PATCH 3/4] dataconnect.yml: oops, forgot to fork adb logcat using '&' --- .github/workflows/dataconnect.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dataconnect.yml b/.github/workflows/dataconnect.yml index 12e01c1ffb1..8671f5b0235 100644 --- a/.github/workflows/dataconnect.yml +++ b/.github/workflows/dataconnect.yml @@ -175,7 +175,7 @@ jobs: ${{ env.FDC_FIREBASE_COMMAND }} emulators:start --only=auth >firebase.emulator.auth.log 2>&1 & - name: Capture Logcat Logs - run: adb logcat >logcat.log + run: adb logcat >logcat.log & - name: Gradle connectedCheck id: connectedCheck From 7c5f75d6a8a578a81212b9309f376395e3382620 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Wed, 5 Feb 2025 07:17:57 +0000 Subject: [PATCH 4/4] empty commit to force github actions