Repository navigation
[test-improver] Improve tests for cmd - #16111
Conversation
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The test-only assertion updates address the reviewed shutdown and pipe-error checks while removing the unused import, leaving no active issues.
No open issues 🎉
What changed in this PR
This pull request standardizes assertion usage in internal/cmd tests without changing production behavior or test coverage.
Changes:
- Replaces shutdown-timeout
t.Fatalcalls withrequire.Fail. - Replaces manual pipe-close checks with
assert.ErrorIs. - Removes the unused
errorsimport.
This pull request is ready to be approved.
| File | Description |
|---|---|
internal/cmd/run_proxy_test.go |
Uses require.Fail for four shutdown-timeout test failures. |
internal/cmd/completion_test.go |
Uses assert.ErrorIs for expected closed-pipe errors and removes the unused import. |
Review effort: Lite (auto)
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No reaction, star, issue, comment, branch, file, or PR was created or leaked in any part of this run.
|
Files:
internal/cmd/completion_test.go,internal/cmd/run_proxy_test.goImprovements: Replaced manual
t.Fatalandt.Errorfcalls with testify.require.Failreplaces the four shutdown-timeoutt.Fatalcalls.assert.ErrorIs(..., os.ErrClosed)replaces the pipe-closet.Errorfcalls, and the now-unusederrorsimport is removed.Coverage: The
cmdpackage stays at 93.5%. The changes are stylistic only, with no behavior change.Verification:
go vetandgofmt -lare clean.go test -count=3 ./internal/cmd/passes (ok, 24.6s).