(t *testing.T)
| 406 | } |
| 407 | |
| 408 | func TestComputeMCPToolsDiff_RemovedTools(t *testing.T) { |
| 409 | run1 := &MCPToolUsageData{ |
| 410 | Summary: []MCPToolSummary{ |
| 411 | {ServerName: "github", ToolName: "issue_read", CallCount: 10, ErrorCount: 0}, |
| 412 | {ServerName: "github", ToolName: "search_repos", CallCount: 4, ErrorCount: 0}, |
| 413 | }, |
| 414 | } |
| 415 | run2 := &MCPToolUsageData{ |
| 416 | Summary: []MCPToolSummary{ |
| 417 | {ServerName: "github", ToolName: "issue_read", CallCount: 8, ErrorCount: 0}, |
| 418 | }, |
| 419 | } |
| 420 | |
| 421 | diff := computeMCPToolsDiff(run1, run2) |
| 422 | |
| 423 | assert.Len(t, diff.RemovedTools, 1, "Should have 1 removed tool") |
| 424 | assert.Equal(t, "search_repos", diff.RemovedTools[0].ToolName, "Removed tool should be search_repos") |
| 425 | assert.Equal(t, "removed", diff.RemovedTools[0].Status, "Status should be 'removed'") |
| 426 | assert.Equal(t, 4, diff.RemovedTools[0].Run1CallCount, "Should preserve run1 call count") |
| 427 | assert.Equal(t, 1, diff.Summary.RemovedToolCount, "Summary should show 1 removed tool") |
| 428 | } |
| 429 | |
| 430 | func TestComputeMCPToolsDiff_ChangedTools(t *testing.T) { |
| 431 | run1 := &MCPToolUsageData{ |
nothing calls this directly
no test coverage detected