(janitor/test-prune): remove mock-echo pass-through tests in admin routers - #5761
Open
kilo-code-bot[bot] wants to merge 1 commit into
Open
(janitor/test-prune): remove mock-echo pass-through tests in admin routers#5761kilo-code-bot[bot] wants to merge 1 commit into
kilo-code-bot[bot] wants to merge 1 commit into
Conversation
…uters
Remove three tests that assert the router returns the exact value
configured into a same-test mock, over production code that is a literal
pass-through with no input transformation or branching.
- admin.github.getKilocodeOpenPullRequestCounts ("returns PR counts for
admin users"): the procedure body is
`return getKilocodeRepoOpenPullRequestCounts({ ttlMs: 2 * 60_000 })`.
The test asserts `result` equals the value it set on the
`getKilocodeRepoOpenPullRequestCounts` mock, with no argument-forwarding
assertion, so the only detectable "regression" is the mock's own
configuration. The admin gate is covered by the sibling
"throws FORBIDDEN for non-admin users" test.
- admin.github.getKilocodeRecentlyMergedExternalPRs ("returns recently
merged external PRs for admin users"): same shape —
`return getKilocodeRepoRecentlyMergedExternalPRs({ ttlMs, maxResults })`
with no argument assertion. FORBIDDEN gate already covered.
- admin.kiloclawProviders.getRollout ("returns provider rollout config
from the Worker"): `return client.getProviderRollout()` with no input
and no transformation. The only assertion is that the mocked client
result is echoed back. Admin gate covered by "rejects non-admin users".
The surviving tests in each describe block still verify the admin
authorization gate, and the arg-forwarding tests for the summary/closed
endpoints (which do transform inputs via `?? ALL_REPO_IDS` and
`includeDrafts ?? false`) are retained.
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by grok-4.6 · Input: 108.8K · Output: 4K · Cached: 104.8K Review guidance: REVIEW.md from base branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes three tautological "mock-echo" tests in the admin tRPC routers. Each asserts that a router procedure returns the exact value configured into a same-test mock, over production code that is a literal pass-through (no input transformation, no branching, no argument forwarding).
What was removed and why
admin.github.getKilocodeOpenPullRequestCounts— "returns PR counts for admin users"return getKilocodeRepoOpenPullRequestCounts({ ttlMs: 2 * 60_000 })resultequals the value it set on the mock; notoHaveBeenCalledWith, so the only failing change is the mock's own config.admin.github.getKilocodeRecentlyMergedExternalPRs— "returns recently merged external PRs for admin users"return getKilocodeRepoRecentlyMergedExternalPRs({ ttlMs: 2 * 60_000, maxResults: 50 })admin.kiloclawProviders.getRollout— "returns provider rollout config from the Worker"return client.getProviderRollout()Surviving coverage
"throws FORBIDDEN for non-admin users"/"rejects non-admin users"tests in the samedescribeblocks.getKilocodeOpenPullRequestsSummaryandgetKilocodeRecentlyClosedExternalPRs(they asserttoHaveBeenCalledWithforrepos/includeDrafts, guarding theinput?.repos ?? [...ALL_REPO_IDS]andincludeDrafts ?? falsedefaults).Verification
oxlinton both files: 0 warnings, 0 errors.tsgo --noEmit(web): passed.cleanupDbForTestfails at connection). The change is deletion-only.The removed tests could not detect any additional plausible regression beyond what the surviving gate and arg-forwarding tests already cover.