File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
.github/actions/e2e/run-log-tests Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 35
35
36
36
# Extract failed test files using the correct JSON structure
37
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)
38
+
39
+ # Debug: Check the actual JSON structure for failed tests
40
+ echo "Debug: Checking for failed tests in JSON..."
41
+ echo "Stats unexpected: $(cat "$E2E_RESULT_FILEPATH" | jq -r '.stats.unexpected' 2>/dev/null || echo "Failed to get stats")"
42
+
43
+ # Try to find any test with unexpected status
44
+ echo "Debug: Looking for tests with unexpected status..."
45
+ cat "$E2E_RESULT_FILEPATH" | jq -r '[.. | select(.status? == "unexpected") | .status] | .[]' 2>/dev/null || echo "No unexpected tests found"
46
+
47
+ # Try the correct command that handles nested suites
48
+ echo "Debug: Running jq command to extract failed files..."
49
+ FAILED_FILES=$(cat "$E2E_RESULT_FILEPATH" | jq -r '[.. | select(.tests? and (.tests[] | .status == "unexpected")) | .file] | unique | .[]' 2>/dev/null)
50
+ echo "Debug: jq command exit code: $?"
51
+ echo "Debug: FAILED_FILES content: '$FAILED_FILES'"
39
52
40
53
if [[ -n "$FAILED_FILES" ]]; then
41
54
echo "Retrying failed test files: $FAILED_FILES"
46
59
echo "JSON keys: $(cat "$E2E_RESULT_FILEPATH" | jq -r 'keys | .[]' 2>/dev/null || echo "Failed to get keys")"
47
60
echo "Has suites: $(cat "$E2E_RESULT_FILEPATH" | jq -r 'has("suites")' 2>/dev/null || echo "Failed to check suites")"
48
61
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
62
fi
51
63
else
52
64
echo "Error: Results file not found at $E2E_RESULT_FILEPATH"
You can’t perform that action at this time.
0 commit comments