MCPcopy Index your code
hub / github.com/docker/docker-agent / TestComputeSummary

Function TestComputeSummary

pkg/evaluation/eval_test.go:215–304  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

213}
214
215func TestComputeSummary(t *testing.T) {
216 t.Parallel()
217
218 tests := []struct {
219 name string
220 results []Result
221 wantTotalCost float64
222 wantTotalEvals int
223 wantSizesPassed int
224 wantSizesTotal int
225 wantRelevance float64
226 wantRelevanceTotal float64
227 }{
228 {
229 name: "no results",
230 results: []Result{},
231 wantTotalCost: 0,
232 wantTotalEvals: 0,
233 wantSizesPassed: 0,
234 wantSizesTotal: 0,
235 },
236 {
237 name: "all passed",
238 results: []Result{
239 {
240 Title: "session1",
241 Cost: 0.01,
242 SizeExpected: "M",
243 Size: "M",
244 },
245 },
246 wantTotalCost: 0.01,
247 wantTotalEvals: 1,
248 wantSizesPassed: 1,
249 wantSizesTotal: 1,
250 },
251 {
252 name: "size mismatch",
253 results: []Result{
254 {
255 Title: "session1",
256 SizeExpected: "M",
257 Size: "S",
258 },
259 },
260 wantTotalEvals: 1,
261 wantSizesPassed: 0,
262 wantSizesTotal: 1,
263 },
264 {
265 name: "multiple sessions",
266 results: []Result{
267 {Title: "session1", Cost: 0.01, SizeExpected: "M", Size: "M"},
268 {Title: "session2", Cost: 0.02, SizeExpected: "L", Size: "S"},
269 {Title: "session3", Cost: 0.03},
270 },
271 wantTotalCost: 0.06,
272 wantTotalEvals: 3,

Callers

nothing calls this directly

Calls 2

computeSummaryFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected