Skip to content

Commit e324874

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Fix workflow-retry for android (#51684)
Summary: The retry mechanism introduced in [this commit]() works for iOS e2e failures but it is skipped if android e2e tests fails. This change should fix that ## Changelog: [Internal] - Fix retry for Android E2E tests Pull Request resolved: #51684 Test Plan: GHA Reviewed By: rshest Differential Revision: D75719890 Pulled By: cipolleschi fbshipit-source-id: 0c2a22268bb655617eaf27f61227a46650878b4e
1 parent 93920e3 commit e324874

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

.github/workflows/test-all.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,12 +644,31 @@ jobs:
644644
# This is exactly the same as rerunning failed tests from the GH UI, but automated.
645645
rerun-failed-jobs:
646646
runs-on: ubuntu-latest
647-
needs: [test_e2e_ios_rntester, test_e2e_android_rntester,test_e2e_ios_templateapp, test_e2e_android_templateapp]
648-
if: failure() && fromJSON(github.run_attempt) < 3 && ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
647+
needs: [test_e2e_ios_rntester, test_e2e_android_rntester, test_e2e_ios_templateapp, test_e2e_android_templateapp]
648+
if: always()
649649
steps:
650650
- name: Checkout
651651
uses: actions/checkout@v4
652652
- name: Rerun failed jobs in the current workflow
653653
env:
654654
GH_TOKEN: ${{ github.token }}
655-
run: gh workflow run retry-workflow.yml -F run_id=${{ github.run_id }}
655+
run: |
656+
SHOULD_RETRY=${{fromJSON(github.run_attempt) < 3}}
657+
if [[ $SHOULD_RETRY == "false" ]]; then
658+
exit 0
659+
fi
660+
661+
RNTESTER_ANDROID_FAILED=${{ needs.test_e2e_android_rntester.result == 'failure' }}
662+
TEMPLATE_ANDROID_FAILED=${{ needs.test_e2e_android_templateapp.result == 'failure' }}
663+
RNTESTER_IOS_FAILED=${{ needs.test_e2e_ios_rntester.result == 'failure' }}
664+
TEMPLATE_IOS_FAILED=${{ needs.test_e2e_ios_templateapp.result == 'failure' }}
665+
666+
echo "RNTESTER_ANDROID_FAILED: $RNTESTER_ANDROID_FAILED"
667+
echo "TEMPLATE_ANDROID_FAILED: $TEMPLATE_ANDROID_FAILED"
668+
echo "RNTESTER_IOS_FAILED: $RNTESTER_IOS_FAILED"
669+
echo "TEMPLATE_IOS_FAILED: $TEMPLATE_IOS_FAILED"
670+
671+
if [[ $RNTESTER_ANDROID_FAILED == "true" || $TEMPLATE_ANDROID_FAILED == "true" || $RNTESTER_IOS_FAILED == "true" || $TEMPLATE_IOS_FAILED == "true" ]]; then
672+
echo "Rerunning failed jobs in the current workflow"
673+
gh workflow run retry-workflow.yml -F run_id=${{ github.run_id }}
674+
fi

packages/rn-tester/.maestro/button.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ appId: ${APP_ID} # iOS: com.meta.RNTester.localDevelopment | Android: com.facebo
99
speed: 40
1010
- tapOn:
1111
id: "Button"
12-
- tapOn:
12+
- tapOn:
1313
id: "button_default_styling"
1414
- assertVisible: "Your application has been submitted!"
1515
- tapOn: "OK"

0 commit comments

Comments
 (0)