MCPcopy Create free account
hub / github.com/docker/model-test / printAgentSummary

Function printAgentSummary

main.go:136–217  ·  view source on GitHub ↗

printAgentSummary prints a summary of the agent test results

(report *models.AgentReport)

Source from the content-addressed store, hash-verified

134
135// printAgentSummary prints a summary of the agent test results
136func printAgentSummary(report *models.AgentReport) {
137 fmt.Println("📈 Agent Test Results")
138 fmt.Println(strings.Repeat("=", 50))
139
140 // Print overall statistics
141 fmt.Printf("Total Tests: %d\n", report.TotalTests)
142 fmt.Printf("✅ Passed: %d\n", report.PassedTests)
143 fmt.Printf("❌ Failed: %d\n", report.FailedTests)
144 fmt.Printf("⏱️ Total LLM Time: %v\n", report.TotalLLMTime)
145 fmt.Printf("⏱️ Average Time per Request: %v\n", report.AvgTimePerReq)
146 fmt.Println()
147
148 // Print results by test case
149 fmt.Println("📋 Test Case Results:")
150 fmt.Println(strings.Repeat("-", 50))
151
152 for _, result := range report.Results {
153 status := "❌ FAILED"
154 if result.Success {
155 status = "✅ PASSED"
156 }
157
158 fmt.Printf("Test Case: %s\n", result.TestCase.Name)
159 fmt.Printf(" Status: %s\n", status)
160 if result.MatchedPath != "" {
161 fmt.Printf(" Matched Path: %s\n", result.MatchedPath)
162 }
163 fmt.Printf(" Response Time: %v\n", result.ResponseTime)
164
165 if result.Response != nil {
166 fmt.Printf(" Tool Calls: %d\n", len(result.Response.ToolCalls))
167 if len(result.Response.ToolCalls) > 0 {
168 fmt.Printf(" Tools Used: ")
169 for i, toolCall := range result.Response.ToolCalls {
170 if i > 0 {
171 fmt.Printf(", ")
172 }
173 fmt.Printf("%s", toolCall.ToolName)
174 }
175 fmt.Println()
176 }
177 }
178
179 if result.ErrorMessage != "" {
180 fmt.Printf(" Error: %s\n", result.ErrorMessage)
181 }
182
183 fmt.Println(strings.Repeat("-", 30))
184 }
185
186 // Print failed tests details
187 if report.FailedTests > 0 {
188 fmt.Println("\n❌ Failed Tests Details:")
189 fmt.Println(strings.Repeat("-", 50))
190 for _, result := range report.Results {
191 if !result.Success {
192 fmt.Printf("Test Case: %s\n", result.TestCase.Name)
193 fmt.Printf("Expected Tool Variants: %d\n", len(result.TestCase.ExpectedToolVariants))

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected