[log] Add debug logging to internal/testutil/mcptest/server.go - #10837
Conversation
Add a logServer debug logger (namespace testutil:server) alongside the existing user-facing log.Printf calls in this test-server helper, and log tool-call parse/handler errors and server start/stop transitions for easier troubleshooting when debugging test failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds debug diagnostics to the configurable MCP test server.
Changes:
- Logs server startup configuration and shutdown.
- Logs tool argument parsing and handler failures.
Show a summary per file
| File | Description |
|---|---|
internal/testutil/mcptest/server.go |
Adds test-server debug logging. |
Review details
Tip
Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Balanced
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
🔒 mcpg Read-Only Stress — gVisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS
References: §31228625148
|
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS Notes:
References: §31228625139
|
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
1 MCP read calls returned 401 (credentials not propagated to direct MCP tool interface in this sandbox). CLI-proxy reads succeeded. No write leaked. Overall: PASS — zero writes succeeded across all surfaces. References: §31228625144
|
Summary
Adds a debug logger (
logServer, namespacetestutil:server) tointernal/testutil/mcptest/server.goalongside the existing user-facinglog.Printfcalls, and adds meaningful debug logging calls to help troubleshoot test-server behavior:Start(): logs configured name/version/tool count/resource countStop(): logs when the server context is being cancelledThe logger is named
logServer(notlog) to avoid colliding with the file's existing"log"standard-library import used for user-facing console messages.Validation
go build ./...— succeedsgo vet ./internal/testutil/...— cleango test ./internal/testutil/...— passinggo build -o awmg .) — succeedsOnly this single file was modified, per the single-file-per-PR logging enhancement process.