Repository navigation
Fast dev loop: make test-changed, with the full suite once at the end - #2371
Conversation
âĶuidance scripts/test-changed.sh vets and tests only the changed Go packages, type-checks the frontend and runs vitest related on changed frontend files. qa.md and CLAUDE.md make that the iteration tier and the full suite a once-at-the-end run, with CI on the pushed head counting as it.
PR Summary by QodoAdd change-scoped tests for a faster development loop
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1.
|
âĶnges, quoted -run, project tsc A deleted Go file still selects its package; a testdata file selects its Go package and is passed to vitest related; go.mod changes build and vet the module; frontend config changes type-check and ask for one full vitest run; GO_TEST_RUN is passed as one argument; type-checks use each project's npm run tsc (TypeScript 7).
|
All five fixed in 07729ea:
|
Agents and people iterating on Radar have been running the full suites after every fix: about 20 minutes per branch (
internal/serveralone takes ~4.5 minutes, and the two vitest suites are about 7,700 tests). A focused run of the same change takes about 2 minutes. This makes the fast tier the default and says when the full run is needed.What changed
make test-changed(scripts/test-changed.sh [base], defaultorigin/main). It takes the files changed since the merge base, plus staged, unstaged and untracked files, and runs:go vet+go teston the changed Go packages only, in both the root andpkg/modules.GO_TEST_RUN=<regexp>narrows a big package such asinternal/server.testdata/file selects the Go package that owns it.npm run tsc(TypeScript 7, as in CI) when frontend files changed, thenvitest related --runon the changed files, including sharedtestdata/fixtures the frontend tests import.go.mod/go.sumchanges build and vet the whole module. A frontend config change (package.json, tsconfig, vite/vitest config) runs both type-checks and prints that one full vitest run is needed.NODE_OPTIONS=--no-experimental-webstorageon Node 25 (itslocalStorageglobal breaks jsdom), and runs on the bash 3.2 macOS ships..claude/commands/qa.md: verification has two tiers.make test-changed, once per batch of fixes.ResourcesView.kind-view,TestUpgradeReadinessEndpointLargeMetrics).CLAUDE.md: one paragraph with the same rule next to the day-to-day commands.Testing
scripts/test-changed.sh HEAD~1on this branch picked the 7 changed frontend files of #2348, ran tsc, and ranvitest related(54 files, 404 tests, all pass). The same selection on a branch with Go changes (onlypkg/gitops,pkg/gitops/diagnoseandpkg/issuesapi, plus 24 related vitest files) took about 2 minutes, against about 20 for the full run. Timing depends heavily on machine load. No CI or product code changes.