Repository navigation
Conversation
…earing Twelve of the 28 test/*.test.ts files were referenced by no package.json script, so nothing ran them — not `pnpm test`, not `test:unit`, not a developer following the docs. They looked like coverage in review while executing zero assertions. One had rotted: proxyTerminalErrorAccounting.test.ts expected two upstream attempts, but 33bdd14 made translation-layer auto-fallback opt-in, so the route now makes one. That commit updated the three orphaned proxy suites its author knew about and missed this one, because no run would have told them. Bisected to confirm it passes at 65b27b7 and fails from 33bdd14 onward. - wire all twelve into test:proxy:vitest, test:knowledge-grounding:vitest, test:mcp-result-cache:vitest and test:prompt-redaction:vitest, all chained into test:unit — 300 previously-dead assertions now execute - opt the exhaustion test into auto-fallback so it still reaches the second-attempt path it was written for, and add a companion test pinning the default-off behaviour that broke it - add checkOrphanedTestFiles() to build-validations, which validate:all already runs in CI, so a new unreferenced test file fails the build
|
Warning Review limit reached
Next review available in: 37 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
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. Comment |
✅ Single Commit Policy - COMPLIANTStatus: Policy requirements met • 1 commit • Valid format • Ready for merge 📊 View validation details📝 Commit Details
✅ Validation Results
🤖 Automated validation by NeuroLink Single Commit Enforcement |
🤖 AI Review & Build Compliance ✅Status: AI analysis complete • Build rules validated • Ready for review 📊 View detailed analysis results🛡️ Analysis Complete
📋 Ready for Merge When
🤖 AI analysis complete - check individual code comments for specific feedback |
Review Summary - PR #1267Decision: APPROVED ✅ Files Changed (3 files, self-contained improvements)
Impact on Existing Code
Review ScopeReviewed per file-by-file approach following NeuroLink conventions:
Key Observations
Final VerdictThis is a safe, targeted improvement that enhances CI/CD reliability without touching production code. All changes are well-documented and follow established patterns. No blocking issues found. No inline comments required - all findings are resolved/approved. |
There was a problem hiding this comment.
🟡 Not ready to approve
The new orphan-test validation currently misses at least one existing unreferenced Vitest suite under test/ subdirectories, undermining the “stop new ones appearing” goal until the check and scripts are aligned.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
This PR makes previously unreferenced Vitest suites runnable via package.json scripts, fixes a stale proxy terminal-error accounting test after an auto-fallback behavior change, and adds a build-time validation to prevent “dead” test files from accumulating.
Changes:
- Adds new
test:*:vitestscripts and chains them intotest:unitso the previously orphaned Vitest suites execute. - Updates
proxyTerminalErrorAccounting.test.tsto opt into auto-fallback for the legacy behavior test and adds a companion test for the default-off behavior. - Introduces
checkOrphanedTestFiles()inscripts/build-validations.tsand runs it as part of the validation runner.
File summaries
| File | Description |
|---|---|
test/proxyTerminalErrorAccounting.test.ts |
Fixes a stale test by explicitly opting into auto-fallback and adds coverage for the default-off path. |
scripts/build-validations.ts |
Adds a CI-enforced validation intended to prevent unreferenced Vitest test files. |
package.json |
Wires the orphaned Vitest suites into runnable scripts and chains them into test:unit. |
Review details
Suppressed comments (1)
package.json:225
- There is a Vitest suite at
test/providers/dedupExecuteMap.test.tsthat is not referenced by anypackage.jsonscript, so it remains effectively dead. If the new orphan-test validation is expanded to include subdirectories (or if the intent is to ensure all Vitest suites are runnable), this file should be wired into the scripts block.
"test:proxy:vitest": "pnpm exec vitest run test/proxyAnalysis.test.ts test/proxyConfigHotReload.test.ts test/proxyObservabilityFoundation.test.ts test/proxyReliabilityHardening.test.ts test/proxyReplay.test.ts test/proxyRollingWorkerHandoff.test.ts test/proxyTerminalErrorAccounting.test.ts test/proxyUpdaterFallback.test.ts test/proxyUsageStatsPersistence.test.ts",
"test:knowledge-grounding:vitest": "pnpm exec vitest run test/knowledgeGrounding.test.ts",
"test:mcp-result-cache:vitest": "pnpm exec vitest run test/mcpResultCacheErrorSkip.test.ts",
"test:prompt-redaction:vitest": "pnpm exec vitest run test/promptRedaction.test.ts"
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
| // Match against the scripts block alone: a filename appearing in some other | ||
| // field would otherwise count as "wired" without running anything. | ||
| const scripts = JSON.stringify( | ||
| (JSON.parse(packageJson) as { scripts?: Record<string, string> }) | ||
| .scripts ?? {}, | ||
| ); | ||
|
|
||
| const orphans = fs | ||
| .readdirSync(testDir) | ||
| .filter((name) => name.endsWith(".test.ts")) | ||
| .filter((name) => !scripts.includes(name)); |
| "test:tool-routing-semantic:vitest": "pnpm exec vitest run test/toolRoutingSemantic.test.ts", | ||
| "test:tool-routing-semantic": "pnpm run test:tool-routing-semantic:vitest && npx tsx test/continuous-test-suite-tool-routing-semantic.ts", | ||
| "test:unit": "pnpm run test:envguard && pnpm run test:bugfixes && pnpm run test:file-detector-extension && pnpm run test:file-detector-magic-bytes && pnpm run test:mcp:infra && pnpm run test:mcp:bash && pnpm run test:mcp:limits && pnpm run test:mcp:spans && pnpm run test:autoresearch:redis && pnpm run test:unit:vitest && pnpm run test:tool-routing-cli:vitest && pnpm run test:tool-dedup:vitest && pnpm run test:model-pool:vitest && pnpm run test:litellm-context:vitest && pnpm run test:step-budget-guard:vitest && pnpm run test:system-messages:vitest && pnpm run test:tool-routing-semantic:vitest && pnpm run test:anthropic-tools-policy && pnpm run test:sagemaker-tools && pnpm run test:anthropic-multimodal && pnpm run test:excel-interop && pnpm run test:model-capabilities:vitest && pnpm run test:agent-runtime:vitest && pnpm run test:retry-after:vitest", | ||
| "test:unit": "pnpm run test:envguard && pnpm run test:bugfixes && pnpm run test:file-detector-extension && pnpm run test:file-detector-magic-bytes && pnpm run test:mcp:infra && pnpm run test:mcp:bash && pnpm run test:mcp:limits && pnpm run test:mcp:spans && pnpm run test:autoresearch:redis && pnpm run test:unit:vitest && pnpm run test:tool-routing-cli:vitest && pnpm run test:tool-dedup:vitest && pnpm run test:model-pool:vitest && pnpm run test:litellm-context:vitest && pnpm run test:step-budget-guard:vitest && pnpm run test:system-messages:vitest && pnpm run test:tool-routing-semantic:vitest && pnpm run test:anthropic-tools-policy && pnpm run test:sagemaker-tools && pnpm run test:anthropic-multimodal && pnpm run test:excel-interop && pnpm run test:model-capabilities:vitest && pnpm run test:agent-runtime:vitest && pnpm run test:retry-after:vitest && pnpm run test:proxy:vitest && pnpm run test:knowledge-grounding:vitest && pnpm run test:mcp-result-cache:vitest && pnpm run test:prompt-redaction:vitest", |
|
Closing this — the approach is wrong for this repo. This PR wires 12 Vitest files into
The finding underneath still holds and is being kept, since it is independent of the runner: The related PRs have been corrected the same way: #1253, #1264 and #1265 no longer touch |
The problem
12 of the 28
test/*.test.tsfiles were referenced by nopackage.jsonscript. Nothing ran them — notpnpm test, nottest:unit, not a developer following the docs. They looked like coverage in review while executing zero assertions.One of them had already rotted
proxyTerminalErrorAccounting.test.tsexpects the Claude route to make two upstream attempts. It makes one, because33bdd141 fix(proxy): bound account admission and fallback routingmade translation-layer auto-fallback opt-in. That commit updated the three orphaned proxy suites its author knew about and missed this one — no run would have told them.Bisected to confirm rather than assume: passes at
65b27b75, fails from33bdd141onward, and still fails on today'srelease.The behaviour change is correct; the test was stale. Fixed by opting the mock router into auto-fallback, so the test still reaches the second-attempt path it was written to check (that exhaustion finalizes the terminal error exactly once, not twice — the thing its name is about). Added a companion test pinning the new default-off path, so the change that broke it can't happen silently again.
What this PR does
test:proxy:vitest,test:knowledge-grounding:vitest,test:mcp-result-cache:vitest,test:prompt-redaction:vitest, all chained intotest:unit. 300 previously-dead assertions now execute (234 + 44 + 5 + 17), all green.checkOrphanedTestFiles()inscripts/build-validations.ts, whichvalidate:allalready runs in CI. A new unreferenced test file now fails the build with the file names and the fix.Verification
12 orphaned→VALIDATION FAILED; after,0 orphaned→ passed.1 orphaned→VALIDATION FAILED; restored → passes.scriptsblock alone, so a filename appearing in some otherpackage.jsonfield can't count as wired without running anything.pnpm run check: 0 errors / 4,838 files.pnpm run lint: 0 errors.Worth flagging separately
.github/workflows/ci.ymlrunsformat:check,eslint,validate:all,buildandbuild:cli— no test step at all. So this PR makes the suites runnable and enforced-as-wired, but CI still does not execute them. That is a larger decision (which suites, what runtime budget, which need credentials) and is deliberately not bundled here.