diff --git a/pkg/reporter/stdout_reporter.go b/pkg/reporter/stdout_reporter.go index d116d4e..fbcaea0 100644 --- a/pkg/reporter/stdout_reporter.go +++ b/pkg/reporter/stdout_reporter.go @@ -50,7 +50,9 @@ func PrintSingleGroupStdout(groupReport map[string][]Report) error { totalSuccessCount += stdoutReport.Summary.Passed totalFailureCount += stdoutReport.Summary.Failed fmt.Println(stdoutReport.Text) - fmt.Printf("Summary: %d succeeded, %d failed\n\n", stdoutReport.Summary.Passed, stdoutReport.Summary.Failed) + if checkGroupsForPassFail(group) { + fmt.Printf("Summary: %d succeeded, %d failed\n\n", stdoutReport.Summary.Passed, stdoutReport.Summary.Failed) + } } fmt.Printf("Total Summary: %d succeeded, %d failed\n", totalSuccessCount, totalFailureCount) @@ -70,7 +72,9 @@ func PrintDoubleGroupStdout(groupReport map[string]map[string][]Report) error { totalSuccessCount += stdoutReport.Summary.Passed totalFailureCount += stdoutReport.Summary.Failed fmt.Println(stdoutReport.Text) - fmt.Printf(" Summary: %d succeeded, %d failed\n\n", stdoutReport.Summary.Passed, stdoutReport.Summary.Failed) + if checkGroupsForPassFail(group, group2) { + fmt.Printf(" Summary: %d succeeded, %d failed\n\n", stdoutReport.Summary.Passed, stdoutReport.Summary.Failed) + } } } @@ -94,7 +98,9 @@ func PrintTripleGroupStdout(groupReport map[string]map[string]map[string][]Repor totalSuccessCount += stdoutReport.Summary.Passed totalFailureCount += stdoutReport.Summary.Failed fmt.Println(stdoutReport.Text) - fmt.Printf(" Summary: %d succeeded, %d failed\n\n", stdoutReport.Summary.Passed, stdoutReport.Summary.Failed) + if checkGroupsForPassFail(groupOne, groupTwo, groupThree) { + fmt.Printf(" Summary: %d succeeded, %d failed\n\n", stdoutReport.Summary.Passed, stdoutReport.Summary.Failed) + } } } } @@ -103,6 +109,16 @@ func PrintTripleGroupStdout(groupReport map[string]map[string]map[string][]Repor return nil } +// Checks if any of the provided groups are "Passed" or "Failed". +func checkGroupsForPassFail(groups ...string) bool { + for _, group := range groups { + if group == "Passed" || group == "Failed" { + return false + } + } + return true +} + // Creates the standard text report func createStdoutReport(reports []Report, indentSize int) reportStdout { result := reportStdout{}