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

Function TestComputeAuditDiff_MultipleRuns

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

Source from the content-addressed store, hash-verified

879}
880
881func TestComputeAuditDiff_MultipleRuns(t *testing.T) {
882 base := &RunSummary{
883 RunID: 100,
884 FirewallAnalysis: &FirewallAnalysis{
885 RequestsByDomain: map[string]DomainRequestStats{
886 "api.github.com:443": {Allowed: 5, Blocked: 0},
887 },
888 },
889 MCPToolUsage: &MCPToolUsageData{
890 Summary: []MCPToolSummary{
891 {ServerName: "github", ToolName: "issue_read", CallCount: 3, ErrorCount: 0},
892 },
893 },
894 Run: WorkflowRun{Turns: 5},
895 TokenUsage: &TokenUsageSummary{
896 TotalInputTokens: 10000,
897 TotalOutputTokens: 2000,
898 TotalRequests: 10,
899 },
900 }
901
902 compare1 := &RunSummary{
903 RunID: 200,
904 FirewallAnalysis: &FirewallAnalysis{
905 RequestsByDomain: map[string]DomainRequestStats{
906 "api.github.com:443": {Allowed: 5, Blocked: 0},
907 "new1.example.com:443": {Allowed: 3, Blocked: 0},
908 },
909 },
910 MCPToolUsage: &MCPToolUsageData{
911 Summary: []MCPToolSummary{
912 {ServerName: "github", ToolName: "issue_read", CallCount: 5, ErrorCount: 0},
913 },
914 },
915 Run: WorkflowRun{Turns: 7},
916 TokenUsage: &TokenUsageSummary{
917 TotalInputTokens: 15000,
918 TotalOutputTokens: 3000,
919 TotalRequests: 12,
920 },
921 }
922
923 compare2 := &RunSummary{
924 RunID: 300,
925 FirewallAnalysis: &FirewallAnalysis{
926 RequestsByDomain: map[string]DomainRequestStats{
927 "api.github.com:443": {Allowed: 5, Blocked: 0},
928 "new2.example.com:443": {Allowed: 1, Blocked: 2},
929 },
930 },
931 Run: WorkflowRun{Turns: 4},
932 TokenUsage: &TokenUsageSummary{
933 TotalInputTokens: 8000,
934 TotalOutputTokens: 1500,
935 TotalRequests: 8,
936 },
937 }
938

Callers

nothing calls this directly

Calls 1

computeAuditDiffFunction · 0.85

Tested by

no test coverage detected