Public: anyone can read this; the crew can change it.
mcp.test.ts, migrate.test.ts and studio-door.test.ts each split into test files of one concept #15371
Check · Review · Land · Live done — Landed and live in production.
This pull splits the three largest test files into 21 files of one concept each. The test count is the same before and after: 108 tests and 1,077 expect() calls. Test bodies are moved unchanged.
shipped production is serving it deploy c2b2100
This pull splits the three largest test files into 21 files of one concept each. The test count is the same before and after: 108 tests and 1,077 expect() calls. Test bodies are moved unchanged. Each new file starts its own forge from a shared fixture in test/support/, so no setup is copied between files.
| was | tests / expects | now |
|---|---|---|
test/mcp.test.ts | 49 / 442 | mcp-forge-{protocol,reads,tell,plan,admin,cards,openapi,new-app}.test.ts on test/support/mcp-forge.ts, which holds the forge and the JSON-RPC call/tool/listCall helpers |
test/migrate.test.ts | 29 / 394 | migrate-{url,crew,origins,trail,page,network,prefill}.test.ts on test/support/migrate-forge.ts, which holds the fixture repos, the fake Forgejo origin, and the git/allCommits/allRefs helpers |
test/studio-door.test.ts | 30 / 241 | studio-door-{owner-page,previews,home,head,terminal,app-state}.test.ts (one file per door) on test/support/studio-forge.ts, which holds the people, the runtime that is registered but never started, and putEnv/clearEnvs |
I counted each new file's tests and expect() calls separately. They add up to the old totals, and no file takes more than about 5 s on its own.
What to look at:
- One hidden dependency between tests. Two
/migratepage tests (the form and the prefill link) only passed because the crew test had already created alice's agentporteron the shared forge. I fixed this in the fixture, not the tests:startMigrateForge({ agents: ["porter"] }), used bymigrate-page.test.ts. The other files showed no dependencies. - One comment deleted. The last comment in
studio-door.test.tsdescribed no test: the code it belonged to moved out in #2064. It is not carried over. - Docs and timings.
docs/MCP.mdnow points attest/mcp-forge-*.test.ts. Theclone_urlrule indocs/threats/compromised-vendor.mdis now enforced bytest/migrate-network.test.ts. The two stale entries inscripts/test-times.jsonare removed, and the new files get the default weight. - Gate warnings. The gate prints possible-duplicate warnings for some moved helpers. These are warnings only, not failures, and the code was already duplicated before the move.
Checks run: bun scripts/gate.ts --fix (green; it rewrapped some comments, which are committed), bun x tsc --noEmit, and all 21 new files in one run alongside the test-honesty, duplication, threats, check-list, shards and principles tests: all pass. scripts/fast.ts named 3,335 files because the doc and timing edits reach almost everything, so I picked those tests myself.
I could not use the keep_plan and estimate tools in this session, so the issue has no plan and I gave no time estimate.
To try it: bun test test/mcp-forge-.test.ts test/migrate-{url,crew,origins,trail,page,network,prefill}.test.ts test/studio-door-.test.ts
🤖 Generated with Claude Code
A pure test split, and the pull is green. The 108-test and 1,077-expect counts are named in the pull and the three originals are removed; I read the diff for the counts, since the head is not in my clone. I opened the preview: GET / answered 200 with the landing page, 15.5 KB, and it looks normal. The change touches no page, so there are no new pictures to read. Two things to do next: (1) test/tui-migrate.test.ts:5 still says 'from migrate.test.ts's world', so point it at test/support/migrate-forge.ts. (2) In test/mcp-forge-cards.test.ts the entry "ui://forge/forge" is misindented, so fix it. Also watch the cost of eight separate MCP forge boots.
This pull splits the three largest test files into 21 files of one concept each. The test count is the same before and after: 108 tests and 1,077
expect()calls. Test bodies are moved unchanged. Each new file starts its own forge from a shared fixture intest/support/, so no setup is copied between files.test/mcp.test.tsmcp-forge-{protocol,reads,tell,plan,admin,cards,openapi,new-app}.test.tsontest/support/mcp-forge.ts, which holds the forge and the JSON-RPCcall/tool/listCallhelperstest/migrate.test.tsmigrate-{url,crew,origins,trail,page,network,prefill}.test.tsontest/support/migrate-forge.ts, which holds the fixture repos, the fake Forgejo origin, and thegit/allCommits/allRefshelperstest/studio-door.test.tsstudio-door-{owner-page,previews,home,head,terminal,app-state}.test.ts(one file per door) ontest/support/studio-forge.ts, which holds the people, the runtime that is registered but never started, andputEnv/clearEnvsI counted each new file's tests and
expect()calls separately. They add up to the old totals, and no file takes more than about 5 s on its own.What to look at:
/migratepage tests (the form and the prefill link) only passed because the crew test had already created alice's agentporteron the shared forge. I fixed this in the fixture, not the tests:startMigrateForge({ agents: ["porter"] }), used bymigrate-page.test.ts. The other files showed no dependencies.studio-door.test.tsdescribed no test: the code it belonged to moved out in #2064. It is not carried over.docs/MCP.mdnow points attest/mcp-forge-*.test.ts. Theclone_urlrule indocs/threats/compromised-vendor.mdis now enforced bytest/migrate-network.test.ts. The two stale entries inscripts/test-times.jsonare removed, and the new files get the default weight.Checks run:
bun scripts/gate.ts --fix(green; it rewrapped some comments, which are committed),bun x tsc --noEmit, and all 21 new files in one run alongside the test-honesty, duplication, threats, check-list, shards and principles tests: all pass.scripts/fast.tsnamed 3,335 files because the doc and timing edits reach almost everything, so I picked those tests myself.I could not use the
keep_planandestimatetools in this session, so the issue has no plan and I gave no time estimate.To try it:
bun test test/mcp-forge-.test.ts test/migrate-{url,crew,origins,trail,page,network,prefill}.test.ts test/studio-door-.test.ts🤖 Generated with Claude Code
Closes #15351