@@ -123,9 +123,10 @@ run_test() {
123123 tmp_output=$( mktemp)
124124
125125 # Debug: Show command being run
126- echo -e " ${BLUE} [DEBUG] Running: $BIN_DIR /check-performance.sh --paths \" $fixture_file \" --no-log${NC} "
126+ echo -e " ${BLUE} [DEBUG] Running: $BIN_DIR /check-performance.sh --format text -- paths \" $fixture_file \" --no-log${NC} "
127127
128- " $BIN_DIR /check-performance.sh" --paths " $fixture_file " --no-log > " $tmp_output " 2>&1 || true
128+ # Explicitly request text format for consistent parsing across all environments
129+ " $BIN_DIR /check-performance.sh" --format text --paths " $fixture_file " --no-log > " $tmp_output " 2>&1 || true
129130
130131 # Strip ANSI color codes for parsing (using perl for reliability)
131132 local clean_output
@@ -136,23 +137,14 @@ run_test() {
136137 tail -20 " $tmp_output " | perl -pe ' s/\e\[[0-9;]*m//g' | sed ' s/^/ /'
137138 echo " "
138139
139- # Extract counts from JSON output using jq
140- # Note: check-performance.sh defaults to JSON format, so we parse JSON
140+ # Extract counts from text output (no jq dependency)
141141 local actual_errors
142142 local actual_warnings
143143
144- # Try to parse as JSON first (default format)
145- if echo " $clean_output " | jq empty 2> /dev/null; then
146- # Valid JSON - extract from summary
147- actual_errors=$( echo " $clean_output " | jq -r ' .summary.total_errors // 0' 2> /dev/null)
148- actual_warnings=$( echo " $clean_output " | jq -r ' .summary.total_warnings // 0' 2> /dev/null)
149- echo -e " ${BLUE} [DEBUG] Parsed JSON output${NC} "
150- else
151- # Fallback to text format parsing (legacy)
152- actual_errors=$( echo " $clean_output " | grep -E " ^[[:space:]]*Errors:" | grep -oE ' [0-9]+' | head -1)
153- actual_warnings=$( echo " $clean_output " | grep -E " ^[[:space:]]*Warnings:" | grep -oE ' [0-9]+' | head -1)
154- echo -e " ${BLUE} [DEBUG] Parsed text output (fallback)${NC} "
155- fi
144+ # Parse text format output
145+ actual_errors=$( echo " $clean_output " | grep -E " ^[[:space:]]*Errors:" | grep -oE ' [0-9]+' | head -1)
146+ actual_warnings=$( echo " $clean_output " | grep -E " ^[[:space:]]*Warnings:" | grep -oE ' [0-9]+' | head -1)
147+ echo -e " ${BLUE} [DEBUG] Parsed text output${NC} "
156148
157149 # Default to 0 if not found
158150 actual_errors=${actual_errors:- 0}
0 commit comments