Skip to content

Commit 89fc601

Browse files
committed
Enhance E2E test retry logic to only rerun failed tests and provide feedback on the retry process
1 parent c7374d7 commit 89fc601

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/actions/e2e/run-log-tests/action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ runs:
2828
shell: bash
2929
# Filter failed E2E files from the result JSON file, and re-run them.
3030
run: |
31-
npm run test:e2e-ci $(cat $E2E_RESULT_FILEPATH | jq -r '[.suites[] | (if has("suites") then .suites[] | .specs[] else .specs[] end) | select(.tests[].status == "unexpected") | .file] | unique | .[]')
31+
# Extract failed test files and run only those
32+
FAILED_FILES=$(cat $E2E_RESULT_FILEPATH | jq -r '[.suites[] | (if has("suites") then .suites[] | .specs[] else .specs[] end) | select(.tests[].status == "unexpected") | .file] | unique | .[]')
33+
if [[ -n "$FAILED_FILES" ]]; then
34+
echo "Retrying failed test files: $FAILED_FILES"
35+
npx playwright test --config=tests/e2e/playwright.config.ts --grep-invert @todo $FAILED_FILES
36+
else
37+
echo "No failed test files found to retry"
38+
fi
3239
3340
# Archive screenshots if any
3441
- name: Archive e2e test screenshots & logs

0 commit comments

Comments
 (0)