Skip to content

Commit

Permalink
Option to print output into report, when tests have passed
Browse files Browse the repository at this point in the history
A new CLI option: -ginkgo.reportPassed
It will print output for each passed test in the generated report,
including JUnit, Teamcity, and Default reporters.

For example, in JUnit (XML), the test output will be added under:
`<testcase> <passed>`

The default behavior (without this option), prints test output
only if the test case (spec) has failed.

[Fixes #583]
  • Loading branch information
manosnoam committed Jul 7, 2019
1 parent eea6ad0 commit 8108c70
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 751 deletions.
6 changes: 6 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type DefaultReporterConfigType struct {
Succinct bool
Verbose bool
FullTrace bool
ReportPassed bool
}

var DefaultReporterConfig = DefaultReporterConfigType{}
Expand Down Expand Up @@ -98,6 +99,7 @@ func Flags(flagSet *flag.FlagSet, prefix string, includeParallelFlags bool) {
flagSet.BoolVar(&(DefaultReporterConfig.Verbose), prefix+"v", false, "If set, default reporter print out all specs as they begin.")
flagSet.BoolVar(&(DefaultReporterConfig.Succinct), prefix+"succinct", false, "If set, default reporter prints out a very succinct report")
flagSet.BoolVar(&(DefaultReporterConfig.FullTrace), prefix+"trace", false, "If set, default reporter prints out the full stack trace when a failure occurs")
flagSet.BoolVar(&(DefaultReporterConfig.ReportPassed), prefix+"reportPassed", false, "If set, default reporter prints out captured output of passed tests.")
}

func BuildFlagArgs(prefix string, ginkgo GinkgoConfigType, reporter DefaultReporterConfigType) []string {
Expand Down Expand Up @@ -196,5 +198,9 @@ func BuildFlagArgs(prefix string, ginkgo GinkgoConfigType, reporter DefaultRepor
result = append(result, fmt.Sprintf("--%strace", prefix))
}

if reporter.ReportPassed {
result = append(result, fmt.Sprintf("--%sreportPassed", prefix))
}

return result
}
300 changes: 0 additions & 300 deletions ginkgo/main.go

This file was deleted.

Loading

0 comments on commit 8108c70

Please sign in to comment.