From 820dfab7b2085dc23ac102a3fdfc58b5093b32e1 Mon Sep 17 00:00:00 2001 From: Denis Ollier Date: Wed, 10 Apr 2019 09:49:42 +0200 Subject: [PATCH] Print Skip reason in JUnit reporter if one was provided --- reporters/junit_reporter.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reporters/junit_reporter.go b/reporters/junit_reporter.go index d76e2fe77..963caaaff 100644 --- a/reporters/junit_reporter.go +++ b/reporters/junit_reporter.go @@ -50,7 +50,7 @@ type JUnitFailureMessage struct { } type JUnitSkipped struct { - XMLName xml.Name `xml:"skipped"` + Message string `xml:",chardata"` } type JUnitReporter struct { @@ -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)