Skip to content

Commit

Permalink
test: fix detox final status
Browse files Browse the repository at this point in the history
  • Loading branch information
abdurrahman-ledger committed Jan 3, 2025
1 parent e27d9a9 commit 3940f29
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/test-mobile-e2e-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3940f29

Please sign in to comment.