Skip to content

Commit

Permalink
fix(logql-compliance-tester): use integer to compare target and success
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota committed Apr 24, 2024
1 parent 7116b2c commit 3c35f18
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/logql-compliance-tester/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ func verifyTargetCompliance(results []*lokicompliance.Result, target float64) er
}
fmt.Printf("Target: %.2f%%\n", target)

if successPercentage < target {
// Compare with precision up to .01.
if int(successPercentage*100) < int(target*100) {
fmt.Println(color.RedString("FAILED"))
return errors.Errorf("target is %v, passed is %.2f", target, successPercentage)
}
Expand Down

0 comments on commit 3c35f18

Please sign in to comment.