You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCP: Add success-path handler tests for timeline log and resource history tools #1126
Add tests that call the 5 MCP tools from #1044 on a loaded workbench and check the successful responses. Today the handlers are tested only on error paths, and the success output is tested by calling the build*TemplateData helpers directly. This came from the #1044 code review and was moved here because it needs a new test fixture.
Tools
get_timeline_logs
get_log
get_resource_revisions
get_resource_manifest
get_resource_diff
What is missing
setupTestInspectionServer in pkg/server/mcp/workbench_handler_test.go runs an inspection with a dummy task, so the workbench has no timelines or logs. Handler tests can only reach argument checks and *_NOT_FOUND errors.
The following paths are not tested end to end:
Paging with pageToken through handleGetTimelineLogs and handleGetResourceRevisions.
Reading a truncated body in several calls with byteOffset through get_log, get_resource_manifest, and get_resource_diff.
byteOffset past the end of the body returning INVALID_ARGUMENT from the handlers. The check itself is unit tested in TestByteOffsetBeyondBodyResult.
REVISION_NOT_FOUND for an out-of-range revision index on an existing timeline.
Proposed approach
Add a test helper that builds an inspection with a few timelines, logs, and resource revisions. For example, run a task that writes a small fixed history, or load a small .khi file from testdata.
Add table-driven handler tests that compare the full Markdown response.
Acceptance criteria
A shared fixture gives the MCP handler tests a workbench with timelines, logs, and revisions.
Each of the 5 tools has at least one success-path test that compares the full response.
Paging and byteOffset continuation are tested through the handlers.
Related code
pkg/server/mcp/workbench_detail.go: the 5 handlers.
Activity