Skip to content

Commit 10b839c

Browse files
committed
Remove JQ
1 parent 43b8e03 commit 10b839c

4 files changed

Lines changed: 19 additions & 19 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525
- Fixes "command not found" errors when running tests in CI environment
2626
- **Impact:** CI tests now run successfully on pull requests
2727

28+
- **Test Suite** - Fixed output format parsing to work across macOS and Ubuntu
29+
- Changed `run_test()` function to explicitly request `--format text` for consistent parsing
30+
- Removed `jq` dependency from text output parsing (was causing failures in CI)
31+
- Simplified parsing logic to use only text format for fixture validation tests
32+
- JSON format tests already explicitly use `--format json` (no changes needed)
33+
- **Root Cause:** Script was getting JSON output by default but trying to parse as text
34+
- **Impact:** Tests now pass consistently in both local (macOS) and CI (Ubuntu) environments
35+
2836
### Changed
2937
- **Documentation** - Enhanced `dist/TEMPLATES/README.md` with context and background
3038
- Added "What Are Templates?" section explaining the concept and purpose

dist/PATTERN-LIBRARY.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": "1.0.0",
3-
"generated": "2026-01-10T04:15:12Z",
3+
"generated": "2026-01-10T04:42:33Z",
44
"summary": {
55
"total_patterns": 29,
66
"enabled": 29,

dist/PATTERN-LIBRARY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Pattern Library Registry
22

33
**Auto-generated by Pattern Library Manager**
4-
**Last Updated:** 2026-01-10 04:15:12 UTC
4+
**Last Updated:** 2026-01-10 04:42:33 UTC
55

66
---
77

@@ -117,6 +117,6 @@
117117

118118
---
119119

120-
**Generated:** 2026-01-10 04:15:12 UTC
120+
**Generated:** 2026-01-10 04:42:33 UTC
121121
**Version:** 1.0.0
122122
**Tool:** Pattern Library Manager

dist/tests/run-fixture-tests.sh

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)