Public: anyone can read this; the crew can change it.
test/studio-runs.test.ts and test/studio-shipping.test.ts are split by concept so no test file is over 800 lines #14012
Merged 17d 12h ago, live in production
I split test/studio-runs.test.ts (2,503 lines) and test/studio-shipping.test.ts (2,191 lines) into twelve files, one concept each. The largest is 763 lines. The same tests run: 89 tests and 545 expect() calls before and after.
-
Reviews
ApprovedVerified at head d860666: 89 tests and 510 expect() calls before (runs 46 + shipping 43) and after across the twelve new files, equal. Largest file is 763 lines. Shared sign-in lives in one helper; each file keeps its own forge, so no state is shared. This is test-only, so no page, terminal or security surface changes. Two things I would do next: (1) split studio-door (1585 lines), studio-search and studio-changes, which are still over 800; (2) run
bun scripts/test-times.tsor the repo's refresh once so the twelve new files carry times rather than relying on the cache. -
Checks
shipped production is serving it deploy 1b196c6
-
History
- Split studio-runs and studio-shipping tests into twelve files of one concept each d860666
- Studio tests sign in through one helper, test/helpers/studio-signin.ts 0fe8d14
- One definition of a public app: home, the shelf, /explore, /api/v1/explore and /api/v1/apps count the same ones (#13890) 11ed909
- One table test fails when a list page renders empty with no next action (#13958) 018511c
- small: A not-found page for /owner/name offers a search for that name and says a private app looks the same (#13894) 24cac9a
- /explore.atom's `updated` is the newest entry's time, so a reader sees no change until there is one (#13910) e5727fa
- /sitemap.xml also lists the guides, /templates, /security and /status, each with its last change (#13905) 9838ca5
- At the awake ceiling a visitor is told "the forge is full": nothing idle is put to sleep to make room, and boot and spawn do not count (#13831) f1c6342
- /api/v1/changelog names the running commit's short id and when it went live instead of the word dev (#13901) 893a6aa
- An anonymous reader of a public repository sees an allow-listed set of fields, and a test fails on a new one (#13902) e226a74
- A .sqlite file's table opens 100 rows at a time with next and previous links, never loading the whole table (#13953) 70f9cba
- A 20 MB generated CSV opens its first 1,000 rows with bounded memory, proved by a test under a time budget (#13952) 441c250
- /pricing shows each plan's price and monthly credit from the same plans the API lists (#13900) f93c651
- Hosted forges are in no backup (#13839) 8282ca7
- A miss under /.well-known or on a file-like path answers a few bytes of typed JSON or text, never the 10 KB not-found page (#13896) 5190ff5
- The guide lists every kind of file the viewer opens, generated from the same table the viewer reads (#13891) 42e1c5f
- The data volume has under 15% free (#13917) 7d44540
- A pull's preview starts asleep: the first request builds and starts it (#13790) 8636138
- After a person's first ask, their forge's home leads with their app and the ask box, not with "Make your everyday account" (#13808) 8839e6b
- /settings has looks of a changed and an untouched setting line at 390 and 1280 px, light and dark (#13202) 82e562b
I split test/studio-runs.test.ts (2,503 lines) and test/studio-shipping.test.ts (2,191 lines) into twelve files, one concept each. The largest is 763 lines. The same tests run: 89 tests and 545 expect() calls before and after. All twelve pass together and each passes alone.
Two commits:
- Sign-in helper. The
/signinform post was copied 20 times across the two files. It is now one function,signInCookie(base, username), in the newtest/helpers/studio-signin.ts. The tests did not change; the count and expects were checked before and after. - The split. Each
describeblock moved whole, with its ownbeforeAll, its own forge and its own temp dir. So no state, port or path is shared between files, and none depends on another file's order. Each file imports only what it uses.
| from | to |
|---|---|
| studio-runs | studio-slots (1 test), studio-run-words (4), studio-run-page (16), studio-tails (9), studio-now (7), studio-shelf-news (6), studio-run-styles (3) |
| studio-shipping | studio-stranger (11), studio-ship-take-back (6), studio-crew-panel (3), studio-preview-speed (13), studio-week-counts (10) |
What to look at:
scripts/gate.ts: unchanged. It already picks up everytest/*.test.ts, and I checked thatgateFiles()lists all twelve new files.scripts/test-times.json: I removed the entries for the two deleted files and nothing else.test/shards.test.ts("names only files that exist") failed until I did, and the repo's ownrefreshTimesforgets deleted files the same way. The new files have no times yet; the check's cache fills them in.- Moved comment: a comment about issue #65 had been left stranded at the end of
studio-runs. It now sits above the stranger tests it describes, instudio-stranger.test.ts. - Dropped import: I removed an empty
import {} from "../src/core/agents.ts".
Not done:
studio-door,studio-searchandstudio-changesare also over 800 lines, but they are outside this issue.- The
keep_planandestimatetools were not available in this session, so I kept no plan on the issue and recorded no estimate.
Checks run here:
bun scripts/gate.ts --fix: no changes.bun x tsc --noEmit: clean.- The twelve new files, together and one at a time: all pass.
- 18 repo-wide checks over test files (among them
check-list,shards,tree-scans,global-spies-restored,module-state,helpers,unused-exports,scripts-fast): all pass.
scripts/fast.ts named 108 files, about 8½ minutes, and I did not run the rest; the forge's check runs them on this push.
To try it: bun test test/studio-*.test.ts
🤖 Generated with Claude Code
I split
test/studio-runs.test.ts(2,503 lines) andtest/studio-shipping.test.ts(2,191 lines) into twelve files, one concept each. The largest is 763 lines. The same tests run: 89 tests and 545expect()calls before and after. All twelve pass together and each passes alone.Two commits:
/signinform post was copied 20 times across the two files. It is now one function,signInCookie(base, username), in the newtest/helpers/studio-signin.ts. The tests did not change; the count and expects were checked before and after.describeblock moved whole, with its ownbeforeAll, its own forge and its own temp dir. So no state, port or path is shared between files, and none depends on another file's order. Each file imports only what it uses.studio-slots(1 test),studio-run-words(4),studio-run-page(16),studio-tails(9),studio-now(7),studio-shelf-news(6),studio-run-styles(3)studio-stranger(11),studio-ship-take-back(6),studio-crew-panel(3),studio-preview-speed(13),studio-week-counts(10)What to look at:
scripts/gate.ts: unchanged. It already picks up everytest/*.test.ts, and I checked thatgateFiles()lists all twelve new files.scripts/test-times.json: I removed the entries for the two deleted files and nothing else.test/shards.test.ts("names only files that exist") failed until I did, and the repo's ownrefreshTimesforgets deleted files the same way. The new files have no times yet; the check's cache fills them in.studio-runs. It now sits above the stranger tests it describes, instudio-stranger.test.ts.import {} from "../src/core/agents.ts".Not done:
studio-door,studio-searchandstudio-changesare also over 800 lines, but they are outside this issue.keep_planandestimatetools were not available in this session, so I kept no plan on the issue and recorded no estimate.Checks run here:
bun scripts/gate.ts --fix: no changes.bun x tsc --noEmit: clean.check-list,shards,tree-scans,global-spies-restored,module-state,helpers,unused-exports,scripts-fast): all pass.scripts/fast.tsnamed 108 files, about 8½ minutes, and I did not run the rest; the forge's check runs them on this push.To try it:
bun test test/studio-*.test.ts🤖 Generated with Claude Code
Closes #14011