Skip to content

Commit 71f5d85

Browse files
committed
Enable E2E retries on all branches and simplify rerun-failed-jobs
- Remove the PR-only guard from retry jobs so they also run on main and stable branches, providing consistent retry behavior everywhere - Simplify rerun-failed-jobs to only handle Fantom tests, since E2E retries are now handled by the in-workflow retry_1/retry_2 jobs
1 parent 8b73712 commit 71f5d85

1 file changed

Lines changed: 12 additions & 28 deletions

File tree

.github/workflows/test-all.yml

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,14 @@ jobs:
161161

162162
test_e2e_ios_rntester_retry_1:
163163
needs: test_e2e_ios_rntester
164-
if: ${{ github.event_name == 'pull_request' && always() && needs.test_e2e_ios_rntester.outputs.status == 'failure' }}
164+
if: ${{ always() && needs.test_e2e_ios_rntester.outputs.status == 'failure' }}
165165
uses: ./.github/workflows/e2e-ios-rntester.yml
166166
continue-on-error: true
167167
secrets: inherit
168168

169169
test_e2e_ios_rntester_retry_2:
170170
needs: test_e2e_ios_rntester_retry_1
171-
if: ${{ github.event_name == 'pull_request' && always() && needs.test_e2e_ios_rntester_retry_1.outputs.status == 'failure' }}
171+
if: ${{ always() && needs.test_e2e_ios_rntester_retry_1.outputs.status == 'failure' }}
172172
uses: ./.github/workflows/e2e-ios-rntester.yml
173173
continue-on-error: true
174174
secrets: inherit
@@ -181,14 +181,14 @@ jobs:
181181

182182
test_e2e_ios_templateapp_retry_1:
183183
needs: test_e2e_ios_templateapp
184-
if: ${{ github.event_name == 'pull_request' && always() && needs.test_e2e_ios_templateapp.outputs.status == 'failure' }}
184+
if: ${{ always() && needs.test_e2e_ios_templateapp.outputs.status == 'failure' }}
185185
uses: ./.github/workflows/e2e-ios-templateapp.yml
186186
continue-on-error: true
187187
secrets: inherit
188188

189189
test_e2e_ios_templateapp_retry_2:
190190
needs: test_e2e_ios_templateapp_retry_1
191-
if: ${{ github.event_name == 'pull_request' && always() && needs.test_e2e_ios_templateapp_retry_1.outputs.status == 'failure' }}
191+
if: ${{ always() && needs.test_e2e_ios_templateapp_retry_1.outputs.status == 'failure' }}
192192
uses: ./.github/workflows/e2e-ios-templateapp.yml
193193
continue-on-error: true
194194
secrets: inherit
@@ -201,14 +201,14 @@ jobs:
201201

202202
test_e2e_android_templateapp_retry_1:
203203
needs: test_e2e_android_templateapp
204-
if: ${{ github.event_name == 'pull_request' && always() && needs.test_e2e_android_templateapp.outputs.status == 'failure' }}
204+
if: ${{ always() && needs.test_e2e_android_templateapp.outputs.status == 'failure' }}
205205
uses: ./.github/workflows/e2e-android-templateapp.yml
206206
continue-on-error: true
207207
secrets: inherit
208208

209209
test_e2e_android_templateapp_retry_2:
210210
needs: test_e2e_android_templateapp_retry_1
211-
if: ${{ github.event_name == 'pull_request' && always() && needs.test_e2e_android_templateapp_retry_1.outputs.status == 'failure' }}
211+
if: ${{ always() && needs.test_e2e_android_templateapp_retry_1.outputs.status == 'failure' }}
212212
uses: ./.github/workflows/e2e-android-templateapp.yml
213213
continue-on-error: true
214214
secrets: inherit
@@ -284,14 +284,14 @@ jobs:
284284

285285
test_e2e_android_rntester_retry_1:
286286
needs: test_e2e_android_rntester
287-
if: ${{ github.event_name == 'pull_request' && always() && needs.test_e2e_android_rntester.outputs.status == 'failure' }}
287+
if: ${{ always() && needs.test_e2e_android_rntester.outputs.status == 'failure' }}
288288
uses: ./.github/workflows/e2e-android-rntester.yml
289289
continue-on-error: true
290290
secrets: inherit
291291

292292
test_e2e_android_rntester_retry_2:
293293
needs: test_e2e_android_rntester_retry_1
294-
if: ${{ github.event_name == 'pull_request' && always() && needs.test_e2e_android_rntester_retry_1.outputs.status == 'failure' }}
294+
if: ${{ always() && needs.test_e2e_android_rntester_retry_1.outputs.status == 'failure' }}
295295
uses: ./.github/workflows/e2e-android-rntester.yml
296296
continue-on-error: true
297297
secrets: inherit
@@ -506,18 +506,11 @@ jobs:
506506
shell: bash
507507
run: node scripts/debugger-shell/build-binary.js
508508

509-
# This job should help with the E2E flakyness.
510-
# In case E2E tests fails, it launches a new retry-workflow workflow, passing the current run_id as input.
511-
# The retry-workflow reruns only the failed jobs of the current test-all workflow using
512-
# ```
513-
# gh run rerun ${{ inputs.run_id }} --failed
514-
# ```
515-
# From https://stackoverflow.com/a/78314483 it seems like that adding the extra workflow
516-
# rather then calling directly this command should improve stability of this solution.
517-
# This is exactly the same as rerunning failed tests from the GH UI, but automated.
509+
# E2E test retries are now handled by the retry_1/retry_2 reusable workflow jobs above.
510+
# This job only handles Fantom test retries on main.
518511
rerun-failed-jobs:
519512
runs-on: ubuntu-latest
520-
needs: [test_e2e_ios_rntester, test_e2e_android_rntester, test_e2e_ios_templateapp, test_e2e_android_templateapp, run_fantom_tests]
513+
needs: [run_fantom_tests]
521514
if: ${{ github.ref == 'refs/heads/main' && always() }}
522515
steps:
523516
- name: Checkout
@@ -531,19 +524,10 @@ jobs:
531524
exit 0
532525
fi
533526
534-
RNTESTER_ANDROID_FAILED=${{ needs.test_e2e_android_rntester.result == 'failure' }}
535-
TEMPLATE_ANDROID_FAILED=${{ needs.test_e2e_android_templateapp.result == 'failure' }}
536-
RNTESTER_IOS_FAILED=${{ needs.test_e2e_ios_rntester.result == 'failure' }}
537-
TEMPLATE_IOS_FAILED=${{ needs.test_e2e_ios_templateapp.result == 'failure' }}
538527
FANTOM_TESTS_FAILED=${{ needs.run_fantom_tests.result == 'failure' }}
539-
540-
echo "RNTESTER_ANDROID_FAILED: $RNTESTER_ANDROID_FAILED"
541-
echo "TEMPLATE_ANDROID_FAILED: $TEMPLATE_ANDROID_FAILED"
542-
echo "RNTESTER_IOS_FAILED: $RNTESTER_IOS_FAILED"
543-
echo "TEMPLATE_IOS_FAILED: $TEMPLATE_IOS_FAILED"
544528
echo "FANTOM_TESTS_FAILED: $FANTOM_TESTS_FAILED"
545529
546-
if [[ $RNTESTER_ANDROID_FAILED == "true" || $TEMPLATE_ANDROID_FAILED == "true" || $RNTESTER_IOS_FAILED == "true" || $TEMPLATE_IOS_FAILED == "true" || $FANTOM_TESTS_FAILED == "true" ]]; then
530+
if [[ $FANTOM_TESTS_FAILED == "true" ]]; then
547531
echo "Rerunning failed jobs in the current workflow"
548532
gh workflow run retry-workflow.yml -F run_id=${{ github.run_id }}
549533
fi

0 commit comments

Comments
 (0)