mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-07-06 14:02:52 -05:00
identify skipped tests properly with a message
This commit is contained in:
@ -20,11 +20,16 @@ type JUnitTestSuite struct {
|
||||
}
|
||||
|
||||
type JUnitTestCase struct {
|
||||
XMLName xml.Name `xml:"testcase"`
|
||||
Classname string `xml:"classname,attr"`
|
||||
Name string `xml:"name,attr"`
|
||||
Time string `xml:"time,attr"`
|
||||
Failure *JUnitFailure `xml:"failure,omitempty"`
|
||||
XMLName xml.Name `xml:"testcase"`
|
||||
Classname string `xml:"classname,attr"`
|
||||
Name string `xml:"name,attr"`
|
||||
Time string `xml:"time,attr"`
|
||||
SkipMessage *JUnitSkipMessage `xml:"skipped,omitempty"`
|
||||
Failure *JUnitFailure `xml:"failure,omitempty"`
|
||||
}
|
||||
|
||||
type JUnitSkipMessage struct {
|
||||
Message string `xml:"message,attr"`
|
||||
}
|
||||
|
||||
type JUnitProperty struct {
|
||||
@ -88,6 +93,10 @@ func JUnitReportXML(report *Report, w io.Writer) error {
|
||||
}
|
||||
}
|
||||
|
||||
if test.Result == SKIP {
|
||||
testCase.SkipMessage = &JUnitSkipMessage{strings.Join(test.Output, "\n")}
|
||||
}
|
||||
|
||||
ts.TestCases = append(ts.TestCases, testCase)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user