Repository navigation
chore(tests): parallelize cmd tests that touch no shared state - #2283
Conversation
Add t.Parallel() to 228 top-level cmd tests that a type-aware scan shows reach no package-level var write or global setter, transitively. Refs #58 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 64 billable files and costs up to $16.00.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 22 minutes for your next included review. View limit details
Comment |
Review T (independent, claude-cc-libs-rev-T): APPROVE at 77eda67Method. The go/types scanner, adapted to the cli module and loaded with Tests:true, follows callees across all LeanerCloud packages (pkg/logging, pkg/common, recommendations). It adds two checks: pointer-receiver method calls on globals (the Result. The 228 parallel tests reach:
Limit. The scan does not follow writes through interface calls or function values. |
Review W (independent, claude-cc-libs-rev-W): APPROVE at 77eda67
Notes:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review T (independent, claude-cc-libs-rev-T): APPROVE at 959f00e
|
Review W (independent, claude-cc-libs-rev-W): APPROVE at 959f00e
|
Merge gate verdict (claude-cc-libs)Every gate holds at head 959f00e:
CodeRabbit is waived as a merge gate under the 2026-10-19 decision. Squash-merging. |
Closes #58. This is the cli cmd/ sweep; the go-repo half merged as go#546-#549.
It adds
t.Parallel()to 228 of the 523 top-level tests in cmd/ (package main), in one commit: +228, no deletions, 64 files. Subtests are untouched.Method. A type-aware scanner (go/packages + go/types) walks each test's callees transitively. It reports every write to a package-level var of any package, every call to a global setter, and every package var the test reaches.
Left sequential on purpose:
toolCfg,writeAuditRecordFn,waitBetweenPurchases,shutdownRequested, the*Fnand fetcher seams);rootCmdor the cobra flag vars;os.Stdout,os.Stderr,os.Stdinoros.Args(including the subprocess re-exec tests);AppLoggerusers;t.Setenvandt.Chdirusers;http.DefaultTransportusers.go test -race -count=1 ./cmd/...passes in two separate runs plus a-shuffle=onrun. vet, lint and secrets are clean.Note: wall time is unchanged at about 120s, because the slowest tests are the sequential HTTP-heavy ones. The benefit is that the safe tests are now explicitly marked, rather than a speed-up.
🤖 Generated with Claude Code