Repository navigation
chore: add test:changed for running only affected tests - #6158
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Add the changed-test workflow package.json, CLAUDE.md |
Adds the test:changed script and documents when to use it, its limits for tests that read files through fs, and full-suite triggers in package.json or Vitest configuration. |
Priority:
Estimated code review effort: 1 (Trivial) | ~5 minutes
Change: Other
Possibly related PRs
- openfrontio/OpenFrontIO#6155: Updates Vitest configuration, which the changed-test guidance identifies as a trigger for running the full suite.
- openfrontio/OpenFrontIO#6133: Adds filesystem-based map tests, which the guidance notes may need to be run by name when map files change.
Suggested reviewers: evanpelle
Merge Risk: 
Minimal · previous review 906dc
-
The changed-test command and guidance are localized, with no identified merge-blocking impact.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)
-
Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A changed-test command joins the list
Vitest checks what changed since main
File reads can hide a test from view
Some config changes run the full suite
Clear guidance keeps the steps in view
Comment @coderabbitai help to get the list of available commands.
🤖 Claude Code ReviewVerdict: looks good. Findings: 0 critical, 0 major, 0 minor. No issues found. Checked for bugs and CLAUDE.md compliance. |
🤖 Claude Code ReviewReviewed range: Verdict: looks good. Findings: 0 critical, 0 major, 0 minor. All changes in this range came in with the merge of No issues found. Checked for bugs and CLAUDE.md compliance. |
|
/ready |
Description:
Adds
npm run test:changed, which isvitest run --changed origin/main. It runs only the tests that import something changed on the branch, plus staged, unstaged and new files. Vitest compares against the merge base, so a staleorigin/maindoesn't pull in tests for upstream commits you don't have.CLAUDE.md now lists it and asks agents to use it, or the files they touched, while working, and leave the full suite to CI. Most of the full run goes to a few long simulation tests (NationGoldPerMinute, NationsWorld, TradeTrainScenarios, FullGameSnapshot, NationExecutions). Those 30 tests take about half the suite's test time, and they only matter when the engine changes. When it does, they still get picked.
Measured locally on main (8 cores / 16 threads):
npm testtest:changed, one client file edited (NewsBox.ts)test:changed, one engine file edited (NationMIRVBehavior.ts)Heads-up:
fs(maps intests/testdata/,resources/, snapshot files) aren't picked when only those files change. CLAUDE.md says to run those by name, and CI still runs everything.package.jsonor the vitest config makes it run the whole suite. That includes this PR's own branch. CLAUDE.md mentions this too, so nobody thinks it's broken.npm testor CI.Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
wraith4081