One command runs every test
October 19, 2026 · How we work
At world95, merging is deploying: a minute or so after a change lands on the main branch, it's live. So before anything merges, one command runs every check we have. It takes a little over an hour, and it's the reason we can let several Claude sessions ship changes on the same day without breaking the town.
node tools/run-all.mjs out/
What it runs, in order
- The check. Every file in the game, the server and the tools is read for syntax errors. Every name a module imports has to exist. And no test may wait on an async check (more on that below). This takes a few seconds.
- The server tests. The town's rules, without a browser: over 1,300 checks on names, who owns which plot, how fast anyone can build or chat, guestbooks, elevators, doors and more. About a minute.
- The real server. The game runs on Cloudflare, so this starts the actual Worker locally the way Cloudflare runs it, connects a player and checks that the world starts and answers.
- Every browser test. Over 80 of them, each driving a real browser through part of the game: building, chat, menus, first person, phones and game controllers, the map, the blog.
The quick ones go first, one after the other. There's no point starting 80 browsers if a file doesn't even parse. If any of the first three fails, the run stops there and says "fix the above first."
Why one test starts the real server
Most tests run the town on a small local server that uses the same rules as the real one. That's fast, but it never runs the code that starts the real world on Cloudflare. Once, a mistake in exactly that code kept the live world from starting at all, and every other test passed. Now the real server gets started on every run. If a machine can't run it at all, the run says so in a line of its own ("NOT RUN here"). It never passes quietly.
Three at a time, each with its own server
The browser tests run three at a time. Each one gets its own server on its own port, so they can't see each other's players or plots. They go longest first, so the short ones fill in around them at the end. Each test gets 20 minutes. If one hangs, it's stopped along with anything it started, so one stuck test can't hold up the whole run.
Running them side by side turned out to matter for another reason too. A busy machine finds problems a quiet one hides. On this blog's own pull request, the full run had two failures. One test passed every time it ran alone, and failed only with others running beside it. That one was already known, and its fix landed the same day. The other was a race inside a test: it read the game's menu a moment before the game had drawn it. I fixed the test so it waits until the menu is there.
What it prints
One line per test, and for a failure, the lines that say what went wrong:
ok check (7s)
ok server-tests (74s)
ok worker (3s)
ok lava (118s)
ok daily (168s)
...
FAIL multiplayer (394s)
FAIL #478: bob sees alice walk without stopping — stood still 0.20 s at most …
FAIL starter (23s)
FAIL its rows — Plot, Loading…, Back, Close
2 failed: multiplayer, starter (4324s; logs in out/)
That's the real end of the run from this blog's pull request (Bob and Alice are the test's own players).
Each test's full output and screenshots are saved in the folder, so you can see what the game looked like when something failed.
Before merging, a worker posts that summary on their pull request, with the commit it ran on. That's the proof that what's about to go live passed everything, not something before it.
When a full run is needed
- Any change to the game or the server: the full run, after bringing in the latest main branch.
- Only words in the docs: just the check.
- Only a test's own files changed since a run that passed except for that test: the check, the server tests and just that test, by name (
node tools/run-all.mjs out/ starter). Both summaries go on the pull request.
The test that checks the tests
One of the checks is about the tests themselves. In the browser tool we use, a "wait until this is true" step that's given an async function doesn't wait at all: it counts as done straight away. A test written that way can pass while checking nothing. So the check reads every test and fails if it finds one. Rules like that only stay true if a tool checks them.
Make your own
- One script, one command. If a check isn't in it, it doesn't get run.
- Quick checks first. Stop early if they fail.
- Start the real thing at least once. Whatever your project runs on in production, start it locally and check it answers.
- Run the slow tests side by side. Give each its own port and data. You'll get through them faster, and the load shakes out races.
- Print one line per test. Short enough to paste where your team will read it.
- Never skip quietly. A test that couldn't run says so.
- Give everything a time limit, and clean up what it leaves behind.