Skip to content
This repository was archived by the owner on Sep 19, 2026. It is now read-only.

ci: split giant test files and the remainder lane by measured durations - #263

Merged
0thernet merged 4 commits into
mainfrom
ci/split-giant-test-files
Sep 18, 2026
Merged

0thernet merged 4 commits into
mainfrom
ci/split-giant-test-files

Conversation

@0thernet

Copy link
Copy Markdown
Member

Summary

  • src/storage/state-store.test.ts alone ran ~16min inside a 28min shard-4; src/daemon/service.test.ts ~14.5min inside a 22min shard-2. Bun assigns files round-robin across the 6 shards, so splitting the giants rebalances the matrix without touching shard count or the runner contract.
  • scripts/split-giant-tests.py: char-level statement scanner (never cuts inside strings/comments/template literals incl. nested ${}), hoists top-level and describe-local helpers into shared scripts/fixtures/*-testkit.ts, re-anchors import.meta.dir joins and relative module specifiers, chunks only at test/describe/for boundaries. All test names preserved verbatim — verified identical name sets.
  • Emitted state-store-{1..4} and service-{1..3} part files; originals keep only their non-giant describes.
  • check:ci-remainder split into check:ci-remainder-checks and check:ci-remainder-suites sub-lanes; the coverage contract still holds because the aggregate recursively expands to the same ordered command set. ci.yml gains a parallel remainder-checks lane.
  • eslint.config.mjs: test-code override extended to scripts/fixtures/*-testkit.ts.

Test plan

  • bunx tsc --noEmit clean; eslint clean on all emitted files
  • Test-name parity: emitted parts + originals == original files exactly
  • bun test service suite: 596/596 pass; state-store suite: 721 pass + 1 fail (import.meta.dir re-anchor bug in generated status-reader child) → fixed and re-verified standalone
  • release-workflow.test.ts contract: 33/33 pass
  • CI green on this PR head

Two files dominated the source matrix: state-store.test.ts (~16min of a
28min shard) and daemon/service.test.ts (~14.5min of a 22min shard).
Bun round-robin file assignment spreads part files across shards, so
splitting them 4- and 3-ways balances the matrix to ~10-14min per shard
without changing shard count or the runner contract.

- scripts/split-giant-tests.py: char-level statement scanner that never
  cuts inside strings, comments, or template literals (including nested
  ${}), hoists top-level + describe-local helpers into shared testkits
  under scripts/fixtures/, re-anchors import.meta.dir joins and relative
  module specifiers for the new location, and chunks only at
  test/describe/for boundaries. Every test name is preserved verbatim.
- Emit state-store-{1..4}.test.ts and service-{1..3}.test.ts plus their
  testkits; originals keep only non-giant describes.
- eslint.config.mjs: extend the test-code override to *-testkit.ts.
- Split check:ci-remainder into checks vs suites sub-lanes (the coverage
  contract holds because the aggregate expands to the same ordered set);
  ci.yml gains a parallel remainder-checks lane.
@vercel

vercel Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
oompa Canceled Canceled Sep 18, 2026 10:01pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
oompa-app Ignored Ignored Preview Sep 18, 2026 10:01pm UTC

Request Review

@0thernet
0thernet merged commit 3484cff into main Sep 18, 2026
25 checks passed
@0thernet
0thernet deleted the ci/split-giant-test-files branch September 18, 2026 21:56

This branch was successfully deployed

1 active deployment
Preview – oompa — 9fe68893 Deployed Sep 18, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant