Skip to content

Commit 6a09692

Browse files
committed
Make skipped optional
1 parent c1a639b commit 6a09692

File tree

1 file changed

+8
-6
lines changed
  • internal/testrunner/reporters/formats

1 file changed

+8
-6
lines changed

internal/testrunner/reporters/formats/xunit.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ type testCase struct {
4343
ClassName string `xml:"classname,attr"`
4444
TimeInSeconds float64 `xml:"time,attr"`
4545

46-
Error string `xml:"error,omitempty"`
47-
Failure string `xml:"failure,omitempty"`
48-
Skipped struct {
49-
Message string `xml:"message,attr"`
50-
} `xml:"skipped,omitempty"`
46+
Error string `xml:"error,omitempty"`
47+
Failure string `xml:"failure,omitempty"`
48+
Skipped *skipped `xml:"skipped,omitempty"`
49+
}
50+
51+
type skipped struct {
52+
Message string `xml:"message,attr"`
5153
}
5254

5355
func reportXUnitFormat(results []testrunner.TestResult) (string, error) {
@@ -101,7 +103,7 @@ func reportXUnitFormat(results []testrunner.TestResult) (string, error) {
101103
}
102104

103105
if r.Skipped {
104-
c.Skipped.Message = "test"
106+
c.Skipped = &skipped{""} // TODO: include reason?
105107
}
106108

107109
numTests++

0 commit comments

Comments
 (0)