diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ecce60..1c93e53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,9 @@ jobs: 'arc_close','build_handoff','ralph_gate_check','arc_prereg','verify_gate', 'status','arc_list')] assert len(tools) == 12, tools - print("yeoul-mcp OK — 12 tools") + # ASCII only: the em-dash renders as "?" on the Windows console, which reads like + # a mojibake defect in the log when nothing is actually wrong. + print("yeoul-mcp OK - 12 tools") PY - name: _run subprocess contract (stdin never inherited, UTF-8 pinned) run: python mcp/tests/test_run_contract.py diff --git a/mcp/tests/test_run_contract.py b/mcp/tests/test_run_contract.py index 6ab56cf..bca76b2 100644 --- a/mcp/tests/test_run_contract.py +++ b/mcp/tests/test_run_contract.py @@ -29,9 +29,11 @@ from yeoul_mcp import server # noqa: E402 FAIL = [] +RAN = [] def check(desc, cond, detail=""): + RAN.append(desc) print((" ok " if cond else " FAIL ") + desc + ((" -- " + detail) if detail and not cond else "")) if not cond: FAIL.append(desc) @@ -122,7 +124,18 @@ def main(): test_stdin_not_inherited(tmp) test_utf8_pinned_under_hostile_locale(tmp) test_missing_script_is_not_a_pass(tmp) - print("\n%s (%d failed)" % ("all _run contract tests passed" if not FAIL else "CONTRACT TESTS FAILED", len(FAIL))) + # 🔴 Print WHAT WAS COUNTED, not just the failure count. A run that collected zero checks + # prints "0 failed" too, so that summary cannot tell "everything passed" apart from + # "nothing ran" — and the summary line is what a human quotes later, not the ok lines. + # (substance_check.py already reports `n/n (...)`; these two summaries now match.) + if not RAN: + # Decide BEFORE printing: a summary that says "passed" above a failure line is the + # same trap one line lower down. + print("\nCONTRACT TESTS FAILED: no checks ran at all — an empty run is not a pass") + return 1 + print("\n%s: %d/%d checks passed" + % ("all _run contract tests passed" if not FAIL else "CONTRACT TESTS FAILED", + len(RAN) - len(FAIL), len(RAN))) return 1 if FAIL else 0