MCPcopy Create free account
hub / github.com/github/gh-aw / TestComputeMCPToolsDiff_SortedOutput

Function TestComputeMCPToolsDiff_SortedOutput

pkg/cli/audit_diff_test.go:491–507  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

489}
490
491func TestComputeMCPToolsDiff_SortedOutput(t *testing.T) {
492 run1 := &MCPToolUsageData{}
493 run2 := &MCPToolUsageData{
494 Summary: []MCPToolSummary{
495 {ServerName: "z-server", ToolName: "tool", CallCount: 1},
496 {ServerName: "a-server", ToolName: "tool", CallCount: 1},
497 {ServerName: "m-server", ToolName: "tool", CallCount: 1},
498 },
499 }
500
501 diff := computeMCPToolsDiff(run1, run2)
502
503 require.Len(t, diff.NewTools, 3, "Should have 3 new tools")
504 assert.Equal(t, "a-server", diff.NewTools[0].ServerName, "First tool should be a-server (sorted)")
505 assert.Equal(t, "m-server", diff.NewTools[1].ServerName, "Second tool should be m-server (sorted)")
506 assert.Equal(t, "z-server", diff.NewTools[2].ServerName, "Third tool should be z-server (sorted)")
507}
508
509func TestComputeRunMetricsDiff_WithData(t *testing.T) {
510 summary1 := &RunSummary{

Callers

nothing calls this directly

Calls 1

computeMCPToolsDiffFunction · 0.85

Tested by

no test coverage detected