From 8984520f05d13490cef47edf189a18020446df0a Mon Sep 17 00:00:00 2001 From: giles Date: Thu, 23 Apr 2026 20:08:46 +0000 Subject: [PATCH] js-on-sx: runner fix, 8-test smoke 3/7 (was 0/8) Agent committed before monitor-exit. Full tree still TODO. Co-Authored-By: Claude Opus 4.7 (1M context) --- lib/js/test262-runner.py | 8 ++++ lib/js/test262-scoreboard.json | 70 +++++++++------------------------- lib/js/test262-scoreboard.md | 22 ++--------- 3 files changed, 31 insertions(+), 69 deletions(-) diff --git a/lib/js/test262-runner.py b/lib/js/test262-runner.py index 3d702817..dc30dd75 100644 --- a/lib/js/test262-runner.py +++ b/lib/js/test262-runner.py @@ -803,6 +803,8 @@ def main(argv: list[str]) -> int: ap.add_argument("--per-test-timeout", type=float, default=DEFAULT_PER_TEST_TIMEOUT_S) ap.add_argument("--restart-every", type=int, default=500, help="restart server every N tests to keep memory bounded") + ap.add_argument("--max-per-category", type=int, default=0, + help="cap runnable tests per category (0 = no cap)") ap.add_argument("--output-json", type=str, default=str(REPO / "lib" / "js" / "test262-scoreboard.json")) ap.add_argument("--output-md", type=str, @@ -832,6 +834,7 @@ def main(argv: list[str]) -> int: tests: list[TestCase] = [] results: list[TestResult] = [] + per_cat_count: dict[str, int] = defaultdict(int) for p in all_paths: t = load_test(p) if not t: @@ -840,6 +843,11 @@ def main(argv: list[str]) -> int: if skip: results.append(TestResult(rel=t.rel, category=t.category, status="skip", reason=why)) continue + if args.max_per_category > 0 and per_cat_count[t.category] >= args.max_per_category: + results.append(TestResult(rel=t.rel, category=t.category, status="skip", + reason=f"capped at --max-per-category={args.max_per_category}")) + continue + per_cat_count[t.category] += 1 tests.append(t) print(f"Will run {len(tests)} tests ({len(results)} skipped up front).", file=sys.stderr) diff --git a/lib/js/test262-scoreboard.json b/lib/js/test262-scoreboard.json index da6e3770..2095e6d2 100644 --- a/lib/js/test262-scoreboard.json +++ b/lib/js/test262-scoreboard.json @@ -1,76 +1,44 @@ { "totals": { - "pass": 56, - "fail": 230, - "skip": 39, - "timeout": 2, - "total": 327, - "runnable": 288, - "pass_rate": 19.4 + "pass": 3, + "fail": 4, + "skip": 1, + "timeout": 0, + "total": 8, + "runnable": 7, + "pass_rate": 42.9 }, "categories": [ { "category": "built-ins/Math", - "total": 327, - "pass": 56, - "fail": 230, - "skip": 39, - "timeout": 2, - "pass_rate": 19.4, + "total": 8, + "pass": 3, + "fail": 4, + "skip": 1, + "timeout": 0, + "pass_rate": 42.9, "top_failures": [ - [ - "Test262Error (assertion failed)", - 83 - ], [ "ReferenceError (undefined symbol)", - 62 + 2 ], [ - "TypeError: not a function", - 46 - ], - [ - "SyntaxError (parse/unsupported syntax)", - 35 - ], - [ - "Unhandled: Unexpected token: op '++'\\", - 3 + "Test262Error (assertion failed)", + 2 ] ] } ], "top_failure_modes": [ - [ - "Test262Error (assertion failed)", - 83 - ], [ "ReferenceError (undefined symbol)", - 62 - ], - [ - "TypeError: not a function", - 46 - ], - [ - "SyntaxError (parse/unsupported syntax)", - 35 - ], - [ - "Unhandled: Unexpected token: op '++'\\", - 3 - ], - [ - "Timeout", 2 ], [ - "Unhandled: Not callable: {:random :floor :floor