Repository navigation
Make every Worker test pass on its own - #208
Merged
Merged
Conversation
Quest-Claim: 563286ff8dda6b06
Each Worker test now starts from empty, freshly migrated storage (D1, R2, and Durable Objects via cloudflare:test reset()), so none depends on rows another test left behind. The per-file DELETE FROM cleanups and INSERT OR IGNORE seeds become plain setup. Vitest shuffles files and tests on every run, so CI catches a new order dependence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
marked this pull request as ready for review
October 24, 2026 07:05
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Resolve the quest/m0/README.md conflict by dropping both finished quests (lifecycle-flakes merged in #218, worker-tests finishes here). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Merged
(Written by Claude Opus 5.5) |
Resolve the seed.test.ts conflict by keeping main's seeded(edit) signature and dropping its DELETE FROM batch, which the global reset in test/setup.ts replaces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Merged
(Written by Claude Opus 5.5) |
This was referenced Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Finishes quest/m0/worker-tests.md, a follow-up of kixelated/quest#188.
Summary
isolate: false) against one D1 database migrated once intest/setup.ts, and@cloudflare/vitest-plugin1.x no longer isolates storage per test. Each file cleaned up a hand-picked list of tables withDELETE FROM, so any table (users, accounts, sessions, verifications, R2 objects, Durable Objects) left off a file's list carried over into later tests.test/setup.tsnow callsreset()fromcloudflare:test(it deletes every Durable Object, which also backs Miniflare's D1 and R2) and reapplies the migrations before each test. So every test starts from empty, freshly migrated storage.DELETE FROMlists inbeforeEachare gone, and seeds that usedINSERT OR IGNOREto tolerate leftovers are now plainINSERT, so a leak would fail loudly. This includes the second-user insert from kixelated/quest#188. Mid-test deletes that are part of what a test checks stay.vitest.config.tssetssequence.shuffle: true, so every run, local or CI (just test→just worker-test), shuffles both files and tests and prints its seed. A new order dependence fails there; rerun it withvitest run --sequence.seed=<seed>.Verification
file:line; anit.eachtable counts as one location, and its cases still reset between them) ran alone in its own vitest process: 267/267 passed.reset()drops a D1 table and an R2 object written by the previous test, and that the migrations are reapplied.prettier --check,tsc --noEmit(cloudflare) andquest checkpass. The fulljust check/just testwaited more than 30 minutes behindquest gateon a host loaded by about 15 parallel agents, so I left the rest of those to CI.Choices made without asking
beforeEachinsetup.tsrather than per file, so a new test file is isolated by default.reset()plus reapplying the migrations, rather than deleting rows from every table. It also clears R2 and Durable Objects, needs no table list, and measured no slower.Suggested follow-ups
🤖 Generated with Claude Code
(Written by Claude Opus 5.5)