docs(CLAUDE.md): only use test/regression/ for numbered regressions - #29560
Conversation
test/regression/issue/ is for bugs that have both a GitHub issue number and are actual regressions (worked before, broke). Everything else should be added to the existing test file for the code being changed.
|
Updated 8:40 PM PT - Apr 21st, 2026
❌ @robobun, your commit deef269 has 4 failures in
🧪 To try this PR locally: bunx bun-pr 29560That installs a local version of the PR into your bun-29560 --bun |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
Disabled knowledge base sources:
WalkthroughRefined test organization rules: tests tied to a GitHub issue are placed in Changes
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
…nd test/README.md Lead with the default (add to the existing test file for the code) and frame test/regression/ as the exception. Add concrete examples (fetch bug -> fetch.test.ts). Update test/CLAUDE.md and test/README.md to match so the guidance is consistent across all docs.
There was a problem hiding this comment.
Thanks for the follow-up — all three docs are now consistent. LGTM; the inline nit about test/README.md:11 is optional polish.
Extended reasoning...
Overview
Docs-only change to three files: root CLAUDE.md, test/CLAUDE.md, and test/README.md. Tightens the test-placement rule so test/regression/issue/${N}.test.ts is reserved for true regressions (worked before, then broke) with a GitHub issue number, and makes "add to the existing test file for the code you're changing" the explicit default. My earlier review flagged that test/CLAUDE.md and test/README.md still carried the old wording; deef269 addressed that and all three docs now state the same rule.
Security risks
None. Pure documentation/guidance change — no executable code, config, build scripts, or CI workflows touched.
Level of scrutiny
Low. These are contributor-guidance docs (one human-facing README, two agent-facing CLAUDE.md files). The change is a wording clarification with clear intent, no behavioral side effects, and no CODEOWNERS coverage on the affected paths.
Other factors
The one remaining finding is a nit: the brief directory blurb at test/README.md:11 still says "tests that reproduce a specific issue." That phrasing isn't strictly wrong (a regression is a specific issue) and the detailed rule at line 53 of the same file is correct, so it doesn't reintroduce the contradiction this PR set out to fix. It's a one-line polish item the author can take or leave — not a reason to block.
| ``` | ||
|
|
||
| If you are fixing a bug that was reported from a GitHub issue, remember to add a test in the `test/regression/` directory. | ||
| When fixing a bug, add the test to the existing test file for that code (e.g. a fetch bug → `test/js/web/fetch/fetch.test.ts`). Only use `test/regression/` when the bug has a GitHub issue number **and** is a true regression — it worked in a previous release and then broke. |
There was a problem hiding this comment.
🟡 nit: test/README.md:11 (the directory listing in "Finding tests") still describes regression/ as "tests that reproduce a specific issue" — the loose framing this PR is retiring. Since deef269 already updated line 53 of this file for the same reason, consider tweaking the one-line blurb too, e.g. "regression/ - tests for true regressions (worked in a prior release, then broke) tied to a GitHub issue."
Extended reasoning...
What the issue is
The follow-up commit deef269 synced test/CLAUDE.md and test/README.md with the new placement rule, updating test/README.md:53 to say "only use test/regression/ when the bug has a GitHub issue number and is a true regression". However, the directory-structure listing earlier in the same file was missed:
* `test/`
* `js/` - tests for JavaScript APIs.
* `cli/` - tests for commands, configs, and stdout.
* `bundler/` - tests for the transpiler/bundler.
* `regression/` - tests that reproduce a specific issue. ← line 11
"tests that reproduce a specific issue" is precisely the broad framing the PR description identifies as the problem ("the wording implied any numbered issue → regression dir").
Why this is in scope
This isn't a pre-existing nit being opportunistically flagged — the PR already touched this exact file for this exact reason in response to the earlier review comment. The stated purpose of deef269 was to "sync test/CLAUDE.md and test/README.md", and line 11 is part of test/README.md's description of the regression/ directory. It's a straightforward miss in that sync pass.
Step-by-step: how it conflicts
- A contributor opens
test/README.mdto figure out where their test goes. - The first content section is "Finding tests", which lists
regression/ - tests that reproduce a specific issue. - Their bug is a specific (numbered) issue, so this blurb suggests
regression/is the right home — the old mental model. - Only if they keep reading to line 53 do they see the narrower rule ("and is a true regression — it worked in a previous release and then broke").
- The two descriptions of the same directory now disagree on the qualifying criterion (issue-reproduction vs. true-regression).
It's not a hard contradiction — a true regression is also "a specific issue" — but the whole point of this PR is that the loose phrasing was actively misdirecting people, and this is one remaining instance of it.
Why nothing prevents it
There's no automated consistency check across doc files; line 11 is simply outside the diff hunks and was overlooked.
Suggested fix
Change line 11 to something like:
* `regression/` - tests for true regressions (worked in a prior release, then broke) tied to a GitHub issue.One-line edit, no other impact.
…ven-sh#29560) Clarifies test placement guidance in CLAUDE.md: - `test/regression/issue/${N}.test.ts` is **only** for bugs that have a GitHub issue number **and** are actual regressions (worked in a previous release, then broke). - Everything else should be added to the **existing test file** for the code being changed, not a new standalone file. Previously the wording implied any numbered issue → regression dir, which led to tests being scattered away from the code they cover. --------- Co-authored-by: Alistair Smith <hi@alistair.sh> Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
…ven-sh#29560) Clarifies test placement guidance in CLAUDE.md: - `test/regression/issue/${N}.test.ts` is **only** for bugs that have a GitHub issue number **and** are actual regressions (worked in a previous release, then broke). - Everything else should be added to the **existing test file** for the code being changed, not a new standalone file. Previously the wording implied any numbered issue → regression dir, which led to tests being scattered away from the code they cover. --------- Co-authored-by: Alistair Smith <hi@alistair.sh> Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Clarifies test placement guidance across
CLAUDE.md,test/CLAUDE.md, andtest/README.md:test/js/web/fetch/fetch.test.ts, aBun.servebug goes intest/js/bun/http/serve.test.ts, etc.test/regression/issue/${N}.test.tsis reserved for bugs that have a GitHub issue number and are true regressions (worked in a previous release, then broke). An issue number alone is not enough.Previously the wording implied any numbered issue → regression dir, which scatters tests away from the code they cover (e.g. #29198 added
test/regression/issue/29195.test.tsfor a fetch bug that belonged infetch.test.ts). All three docs now agree.