Repository navigation
[test-improver] Improve tests for MCP sdk method dispatch - #15452
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
π’ Approval recommended
The focused test-only change matches the existing HTTP error-response contract and introduces no identified blocking issues.
No open issues π
What changed in this PR
Strengthens the MCP method-dispatch test by replacing permissive branching with deterministic assertions for HTTP 500 handling. Production behavior and coverage remain unchanged.
Changes:
- Require no Go error and a non-nil response.
- Assert that the response contains a JSON-RPC error.
| File | Description |
|---|---|
internal/βmcp/βsdk_method_dispatch_test.go |
Tightens assertions for the plain JSON HTTP error response. |
Review effort: Max
π mcpg Read-Only Stress β defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE No write leaked through mcpg in any surface tested. However:
No reaction, star, issue, comment, branch, file, or PR was created. Full detail in workflow artifact Run: https://github.com/github/gh-aw-mcpg/actions/runs/40041749448
|
File:
internal/mcp/sdk_method_dispatch_test.goTestSendRequestWithServerID_AgentTags_PlainJSONErrorused a vacuousif err != nil {...} else {...}that accepted any outcome. Replaced with deterministic testify assertions:require.NoError,require.NotNil(resp), andassert.NotNil(resp.Error)(an HTTP 500 surfaces as a JSON-RPC error response).Coverage: package
internal/mcpwas already 99.3%; unchanged. The change tightens the assertion strength only.Verification:
go vetandgofmtare clean.go test -count=3 -run TestSendRequestWithServerID_AgentTags ./internal/mcp/passes. I did not re-run the full package suite after the edit.Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
thishostdoesnotexist12345.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.