From 3af2ca87d184397962d83ffdbde76ad91cb4e2e0 Mon Sep 17 00:00:00 2001 From: Abdurrahman SASTIM Date: Fri, 3 Jan 2025 16:30:18 +0100 Subject: [PATCH] test: fix detox final status --- .../workflows/test-mobile-e2e-reusable.yml | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-mobile-e2e-reusable.yml b/.github/workflows/test-mobile-e2e-reusable.yml index 06bc8ff129e6..469e2b3d8b56 100644 --- a/.github/workflows/test-mobile-e2e-reusable.yml +++ b/.github/workflows/test-mobile-e2e-reusable.yml @@ -158,7 +158,7 @@ jobs: allure-report-ios: name: "Allure Reports Export on Server" runs-on: [ledger-live-medium] - if: ${{ always() && (inputs.slack_notif || github.event_name == 'push') }} + if: ${{ !inputs.speculos_tests && (inputs.slack_notif || github.event_name == 'push') }} needs: [detox-tests-ios] outputs: report-url: ${{ steps.upload.outputs.report-url }} @@ -200,7 +200,9 @@ jobs: AVD_RAM_SIZE: 4096M AVD_OPTIONS: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none outputs: - status: ${{ steps.detox.outcome }} + status_1: ${{ steps.set-output.outputs.status_1 }} + status_2: ${{ steps.set-output.outputs.status_2 }} + status_3: ${{ steps.set-output.outputs.status_3 }} strategy: fail-fast: false matrix: @@ -315,6 +317,10 @@ jobs: with: name: "android-test-artifacts-${{ matrix.shardIndex }}" path: apps/ledger-live-mobile/artifacts/ + - name: Set job output based on detox result + id: set-output + if: always() + run: echo "status_${{ matrix.shardIndex }}=${{ steps.detox.outcome }}" >> $GITHUB_OUTPUT allure-report-android: name: "Allure Reports Export on Server" @@ -323,7 +329,7 @@ jobs: outputs: report-url: ${{ steps.upload.outputs.report-url }} result: ${{ steps.summary.outputs.test_result }} - status: ${{ needs.detox-tests-android.outputs.status }} + finalStatus: ${{ steps.aggregate.outputs.finalStatus }} needs: [detox-tests-android] steps: - name: checkout @@ -344,6 +350,22 @@ jobs: with: allure-results-path: android-test-artifacts platform: android + - name: Aggregate test results + id: aggregate + run: | + if [ "${{ env.SPECULOS_RUN }}" == "true" ]; then + statuses=("${{ needs.detox-tests-android.outputs.status_1 }}" "${{ needs.detox-tests-android.outputs.status_2 }}" "${{ needs.detox-tests-android.outputs.status_3 }}") + else + statuses=("${{ needs.detox-tests-android.outputs.status_1 }}") + fi + finalStatus="success" + for status in "${statuses[@]}"; do + if [ "$status" != "success" ]; then + finalStatus="failure" + break + fi + done + echo "finalStatus=$finalStatus" >> $GITHUB_OUTPUT upload-to-xray: name: "Upload to Xray" @@ -409,7 +431,7 @@ jobs: env: IOS_STATUS: ${{ needs.allure-report-ios.outputs.status }} IOS_REPORT_URL: ${{ needs.allure-report-ios.outputs.report-url }} - ANDROID_STATUS: ${{ needs.allure-report-android.outputs.status }} + ANDROID_STATUS: ${{ needs.allure-report-android.outputs.finalStatus }} ANDROID_REPORT_URL: ${{ needs.allure-report-android.outputs.report-url }} steps: - name: format message