Skip to content

Commit 0712bdf

Browse files
committed
Merge branch 'dev/woopmnt-5249-e2e-ensure-version-coverage-for-woocommerce-and-php' into dev/woopmnt-5251-e2e-investigate-and-re-enable-woocommerce-blocks-e2e-tests
2 parents 70199e9 + 5aa8897 commit 0712bdf

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

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

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,28 @@ 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+
# Check if results file exists
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+
36+
# Extract failed test files using the correct JSON structure
37+
echo "Extracting failed test files..."
38+
FAILED_FILES=$(cat "$E2E_RESULT_FILEPATH" | jq -r '[.suites[] | .specs[] | select(.tests[].status == "unexpected") | .file] | unique | .[]' 2>/dev/null)
39+
40+
if [[ -n "$FAILED_FILES" ]]; then
41+
echo "Retrying failed test files: $FAILED_FILES"
42+
npx playwright test --config=tests/e2e/playwright.config.ts --grep-invert @todo $FAILED_FILES
43+
else
44+
echo "No failed test files found to retry"
45+
echo "Debug: Checking JSON structure..."
46+
echo "JSON keys: $(cat "$E2E_RESULT_FILEPATH" | jq -r 'keys | .[]' 2>/dev/null || echo "Failed to get keys")"
47+
echo "Has suites: $(cat "$E2E_RESULT_FILEPATH" | jq -r 'has("suites")' 2>/dev/null || echo "Failed to check suites")"
48+
echo "Suites count: $(cat "$E2E_RESULT_FILEPATH" | jq -r '.suites | length' 2>/dev/null || echo "Failed to get suites count")"
49+
echo "First suite structure: $(cat "$E2E_RESULT_FILEPATH" | jq -r '.suites[0] | keys | .[]' 2>/dev/null || echo "Failed to get first suite keys")"
50+
fi
3651
else
37-
echo "No failed test files found to retry"
52+
echo "Error: Results file not found at $E2E_RESULT_FILEPATH"
3853
fi
3954
4055
# Archive screenshots if any

0 commit comments

Comments
 (0)