(t *testing.T)
| 283 | } |
| 284 | |
| 285 | func TestHandleGetTrace(t *testing.T) { |
| 286 | server, callAndTestResults := testFrontend() |
| 287 | |
| 288 | tests := []struct { |
| 289 | name string |
| 290 | request mcp.CallToolRequest |
| 291 | expected expectedResult |
| 292 | }{ |
| 293 | { |
| 294 | name: "valid trace ID", |
| 295 | request: callToolRequest(map[string]any{ |
| 296 | "trace_id": "12345678abcdef90", |
| 297 | }), |
| 298 | expected: expectedResult{ |
| 299 | path: "/api/v2/traces/12345678abcdef90", |
| 300 | params: map[string]string{}, |
| 301 | meta: map[string]any{ |
| 302 | "type": "trace", |
| 303 | "encoding": "json", |
| 304 | "version": "2", |
| 305 | }, |
| 306 | }, |
| 307 | }, |
| 308 | { |
| 309 | name: "no trace ID", |
| 310 | request: callToolRequest(map[string]any{}), |
| 311 | expected: expectedResult{ |
| 312 | err: "required argument \"trace_id\" not found", |
| 313 | }, |
| 314 | }, |
| 315 | } |
| 316 | |
| 317 | for _, tt := range tests { |
| 318 | t.Run(tt.name, func(t *testing.T) { |
| 319 | callAndTestResults(t, tt.request, server.handleGetTrace, tt.expected) |
| 320 | }) |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | func TestHandleGetAttributeNames(t *testing.T) { |
| 325 | server, callAndTestResults := testFrontend() |
nothing calls this directly
no test coverage detected