test
Debug Go tests in a package using the Delve debugger to identify and resolve issues in test execution.
Instructions
Debug tests in a package
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| package | No | Package to test (defaults to current directory) | |
| testFlags | No | Flags to pass to go test |
Implementation Reference
- src/handlers/debug.ts:54-64 (handler)Handler function for the 'test' tool: extracts parameters, calls startDebugSession with test flags, and returns session info.case "test": { const pkg = (args?.package as string) || "."; const testFlags = (args?.testFlags as string[]) || []; const session = await startDebugSession("test", pkg, ["--", ...testFlags]); return { content: [{ type: "text", text: `Started test debug session ${session.id} for package ${pkg}` }] };
- src/server.ts:118-135 (schema)Schema definition for the 'test' tool, including input parameters for package and testFlags.{ name: "test", description: "Debug tests in a package", inputSchema: { type: "object", properties: { package: { type: "string", description: "Package to test (defaults to current directory)" }, testFlags: { type: "array", items: { type: "string" }, description: "Flags to pass to go test" } } } },
- src/server.ts:406-407 (registration)Registration and dispatch logic for the 'test' tool in the CallToolRequestHandler, routing to handleDebugCommands.if (["debug", "attach", "exec", "test", "core", "dap", "replay", "trace"].includes(name)) { return handleDebugCommands(name, args);