Skip to content

Commit

Permalink
Fix. Write errors to stderr instead of stdout (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
sowmiyamuthuraman authored and blgm committed Sep 19, 2019
1 parent 974566c commit 7bb3091
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions reporters/junit_reporter.go
Expand Up @@ -143,15 +143,15 @@ func (reporter *JUnitReporter) SpecSuiteDidEnd(summary *types.SuiteSummary) {
reporter.suite.Errors = 0
file, err := os.Create(reporter.filename)
if err != nil {
fmt.Printf("Failed to create JUnit report file: %s\n\t%s", reporter.filename, err.Error())
fmt.Fprintf(os.Stderr, "Failed to create JUnit report file: %s\n\t%s", reporter.filename, err.Error())
}
defer file.Close()
file.WriteString(xml.Header)
encoder := xml.NewEncoder(file)
encoder.Indent(" ", " ")
err = encoder.Encode(reporter.suite)
if err != nil {
fmt.Printf("Failed to generate JUnit report\n\t%s", err.Error())
fmt.Fprintf(os.Stderr, "Failed to generate JUnit report\n\t%s", err.Error())
}
}

Expand Down

0 comments on commit 7bb3091

Please sign in to comment.