junit: Move test output within the XML tag for skipped tests

For consistency with failed tests and tests with unknown status.
This commit is contained in:
Joël Stemmer 2022-03-20 00:09:50 +00:00
parent 1c7fff6728
commit 985100c8e8
3 changed files with 5 additions and 4 deletions

View File

@ -170,7 +170,8 @@ func CreateFromReport(report gtr.Report, hostname string) Testsuites {
}
} else if test.Result == gtr.Skip {
tc.Skipped = &Result{
Message: formatOutput(test.Output, test.Level),
Message: "Skipped",
Data: formatOutput(test.Output, test.Level),
}
} else if test.Result == gtr.Unknown {
tc.Error = &Result{

View File

@ -5,7 +5,7 @@
<property name="go.version" value="1.0"></property>
</properties>
<testcase name="TestOne" classname="package/name" time="0.020">
<skipped message="file_test.go:11: Skip message"></skipped>
<skipped message="Skipped"><![CDATA[file_test.go:11: Skip message]]></skipped>
</testcase>
<testcase name="TestTwo" classname="package/name" time="0.130"></testcase>
</testsuite>

View File

@ -25,11 +25,11 @@
example.go:123: Expected and obtained are different.]]></failure>
</testcase>
<testcase name="TestFour/#01" classname="package/name" time="0.000">
<skipped message="example.go:1234: Not supported yet."></skipped>
<skipped message="Skipped"><![CDATA[example.go:1234: Not supported yet.]]></skipped>
</testcase>
<testcase name="TestFour/#02" classname="package/name" time="0.000"></testcase>
<testcase name="TestFive" classname="package/name" time="0.000">
<skipped message="example.go:1392: Not supported yet."></skipped>
<skipped message="Skipped"><![CDATA[example.go:1392: Not supported yet.]]></skipped>
</testcase>
<testcase name="TestSix" classname="package/name" time="0.000">
<failure message="Failed"><![CDATA[example.go:371: This should not fail!]]></failure>