Skip to content

Commit 6f88140

Browse files
committed
Debug retries
1 parent 89fc601 commit 6f88140

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

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

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,34 @@ runs:
2828
shell: bash
2929
# Filter failed E2E files from the result JSON file, and re-run them.
3030
run: |
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
31+
# Debug: Check if results file exists and show its structure
32+
echo "Checking for results file: $E2E_RESULT_FILEPATH"
33+
if [[ -f "$E2E_RESULT_FILEPATH" ]]; then
34+
echo "Results file exists, size: $(wc -c < "$E2E_RESULT_FILEPATH") bytes"
35+
echo "First 500 characters of results file:"
36+
head -c 500 "$E2E_RESULT_FILEPATH"
37+
echo ""
38+
39+
# Extract failed test files and run only those
40+
echo "Extracting failed test files..."
41+
FAILED_FILES=$(cat "$E2E_RESULT_FILEPATH" | jq -r '[.suites[] | (if has("suites") then .suites[] | .specs[] else .specs[] end) | select(.tests[].status == "unexpected") | .file] | unique | .[]' 2>/dev/null)
42+
43+
if [[ $? -ne 0 ]]; then
44+
echo "Error: jq command failed. Trying alternative JSON structure..."
45+
# Try alternative structure - maybe tests are directly in specs
46+
FAILED_FILES=$(cat "$E2E_RESULT_FILEPATH" | jq -r '[.suites[] | .specs[] | select(.tests[].status == "unexpected") | .file] | unique | .[]' 2>/dev/null)
47+
fi
48+
49+
if [[ -n "$FAILED_FILES" ]]; then
50+
echo "Retrying failed test files: $FAILED_FILES"
51+
npx playwright test --config=tests/e2e/playwright.config.ts --grep-invert @todo $FAILED_FILES
52+
else
53+
echo "No failed test files found to retry"
54+
echo "Debug: Full JSON structure:"
55+
cat "$E2E_RESULT_FILEPATH" | jq '.' | head -50
56+
fi
3657
else
37-
echo "No failed test files found to retry"
58+
echo "Error: Results file not found at $E2E_RESULT_FILEPATH"
3859
fi
3960
4061
# Archive screenshots if any

0 commit comments

Comments
 (0)