@@ -28,13 +28,34 @@ runs:
28
28
shell : bash
29
29
# Filter failed E2E files from the result JSON file, and re-run them.
30
30
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
36
57
else
37
- echo "No failed test files found to retry "
58
+ echo "Error: Results file not found at $E2E_RESULT_FILEPATH "
38
59
fi
39
60
40
61
# Archive screenshots if any
0 commit comments