Skip to content

Commit 13d77df

Browse files
mpstatonclaude
andcommitted
test(test-all): print a grand-total tally so the last suite's count isn't mistaken for the whole
The runner printed each suite's own count but no total, so the final block (id-didi-sh's "29 passed") read as if it were the whole run. Now each suite streams live AND is captured, its passing count parsed (Vitest and ExUnit formats), and the summary reports the grand total — "✅ ALL SUITES PASSED — 67 tests across 7 suites". README's Testing section reconciles the numbers: 67 total = the 43 tests of this effort's ten registry groups + id-didi-sh's pre-existing suite that mix test runs alongside Group A. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L4Z1CLe97uttB5QWaiHe5E
1 parent 51843a4 commit 13d77df

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ Run the whole suite — every package plus the id-didi-sh identity contract —
159159
pnpm test:all
160160
```
161161

162-
That runs `scripts/test-all.sh`: each vitest package in turn, the end-to-end backend-chain integration, and (if `mix` is present) id-didi-sh's ExUnit suite in the sibling repo — with a pass/fail summary at the end. **43 tests across ten groups**, tracked in human language in [`context-v/specs/Corpora-Builder-Harmony-Test-Registry.md`](context-v/specs/Corpora-Builder-Harmony-Test-Registry.md) (each test's name is the ✓-phrase you see go green).
162+
That runs `scripts/test-all.sh`: each vitest package in turn, the end-to-end backend-chain integration, and (if `mix` is present) id-didi-sh's ExUnit suite in the sibling repo — ending with a grand-total tally (e.g. `✅ ALL SUITES PASSED — 67 tests across 7 suites`).
163+
164+
Of that total, **43 tests across ten groups** are the corpora-builder coverage added in this effort — tracked in human language in [`context-v/specs/Corpora-Builder-Harmony-Test-Registry.md`](context-v/specs/Corpora-Builder-Harmony-Test-Registry.md), where each test's name is the ✓-phrase you see go green. The remainder is id-didi-sh's pre-existing suite, which `mix test` runs alongside this effort's Group A.
163165

164166
Run a single group directly with `pnpm test` in its package:
165167

scripts/test-all.sh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,31 @@ set -uo pipefail
1414
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
1515
DIDI="$ROOT/../id-didi-sh"
1616
fail=0
17+
total=0
18+
suites=0
19+
20+
# Pull a passing-test count out of a suite's captured output. Handles both
21+
# Vitest ("Tests N passed (N)") and ExUnit ("Result: N passed" / "N tests, …").
22+
extract_count() {
23+
local f="$1" n
24+
n=$(grep -oE 'Result: [0-9]+ passed' "$f" | grep -oE '[0-9]+' | tail -1)
25+
[ -z "$n" ] && n=$(grep -oE 'Tests[[:space:]]+[0-9]+ passed \([0-9]+\)' "$f" | grep -oE '\([0-9]+\)' | tr -d '()' | tail -1)
26+
[ -z "$n" ] && n=$(grep -oE '[0-9]+ tests?, [0-9]+ failures?' "$f" | grep -oE '^[0-9]+' | tail -1)
27+
echo "${n:-0}"
28+
}
1729

1830
run() { # run <label> <dir> <cmd...>
1931
local label="$1" dir="$2"; shift 2
2032
echo ""
2133
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
2234
echo " $label"
2335
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
24-
if ( cd "$dir" && "$@" ); then :; else echo "$label FAILED"; fail=1; fi
36+
local tmp; tmp=$(mktemp)
37+
( cd "$dir" && "$@" ) 2>&1 | tee "$tmp" # stream live AND capture for the tally
38+
local rc=${PIPESTATUS[0]}
39+
[ "$rc" -ne 0 ] && { echo "$label FAILED"; fail=1; }
40+
local n; n=$(extract_count "$tmp"); rm -f "$tmp"
41+
total=$((total + n)); suites=$((suites + 1))
2542
}
2643

2744
# Clear any leftovers from a previously-interrupted E2E run.
@@ -48,9 +65,9 @@ pkill -f "tsx src/server.ts" 2>/dev/null || true
4865
echo ""
4966
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
5067
if [ "$fail" -eq 0 ]; then
51-
echo " ✅ ALL SUITES PASSED"
68+
echo " ✅ ALL SUITES PASSED${total} tests across ${suites} suites"
5269
else
53-
echo " ❌ SOME SUITES FAILED (see ✗ markers above)"
70+
echo " ❌ SOME SUITES FAILED (see ✗ markers above)${total} tests counted across ${suites} suites"
5471
fi
5572
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
5673
echo ""

0 commit comments

Comments
 (0)