Skip to content

Commit

Permalink
fix: Show detailed message of failed tests even when verbose flag not…
Browse files Browse the repository at this point in the history
… set
  • Loading branch information
hrk091 committed Sep 21, 2024
1 parent 82e44d9 commit 4675bc8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/tester/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,11 @@ func (r *policyEvalResult) String(verbose bool) string {
}
summary += fmt.Sprintf(" - %s ==> %s", strings.ToUpper(string(r.TestCase.Expect)), strings.ToUpper(string(r.Result)))

if !verbose {
return summary
}

out := []string{summary}
for _, d := range r.Decisions {
if r.Pass() && !verbose {
continue
}
// Workaround to handle the case where the evaluation is not set
// TODO remove this workaround after htcps://github.com/kubernetes/kubernetes/pull/126867 is released
if d.Evaluation == "" {
Expand Down

0 comments on commit 4675bc8

Please sign in to comment.