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) <noreply@anthropic.com>
This commit is contained in:
2026-04-23 20:08:46 +00:00
parent 1613f551ef
commit 8984520f05
3 changed files with 31 additions and 69 deletions

View File

@@ -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)