Skip to content

Commit f48ac28

Browse files
committed
Fix cagent eval metric
Signed-off-by: David Gageot <david.gageot@docker.com>
1 parent cdd5b3b commit f48ac28

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/evaluation/scoring.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ func printMetric(out io.Writer, label string, passed, total int) {
128128
}
129129

130130
func printMetricFloat(out io.Writer, label string, passed, total float64) {
131-
ratio := 0.0
132-
if total > 0 {
133-
ratio = passed / total
131+
if total == 0 {
132+
return // Skip metrics with no data
134133
}
134+
ratio := passed / total
135135
fmt.Fprintf(out, "%s %14s: %.0f/%.0f passed (%.1f%%)\n", statusIcon(ratio), label, passed, total, ratio*100)
136136
}
137137

0 commit comments

Comments
 (0)