Skip to content

Commit

Permalink
Print Skip reason in JUnit reporter if one was provided
Browse files Browse the repository at this point in the history
  • Loading branch information
dollierp authored and williammartin committed Jun 18, 2020
1 parent d85a255 commit 820dfab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion reporters/junit_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type JUnitFailureMessage struct {
}

type JUnitSkipped struct {
XMLName xml.Name `xml:"skipped"`
Message string `xml:",chardata"`
}

type JUnitReporter struct {
Expand Down Expand Up @@ -132,6 +132,9 @@ func (reporter *JUnitReporter) SpecDidComplete(specSummary *types.SpecSummary) {
}
if specSummary.State == types.SpecStateSkipped || specSummary.State == types.SpecStatePending {
testCase.Skipped = &JUnitSkipped{}
if specSummary.Failure.Message != "" {
testCase.Skipped.Message = failureMessage(specSummary.Failure)
}
}
testCase.Time = specSummary.RunTime.Seconds()
reporter.suite.TestCases = append(reporter.suite.TestCases, testCase)
Expand Down

0 comments on commit 820dfab

Please sign in to comment.