mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-07-03 20:52:47 -05:00
Remove custom properties parsed from test output
In the future it will be possible to add your own properties via commandline flags.
This commit is contained in:
@ -205,8 +205,6 @@ func testReport(input, reportFile, packageName string, t *testing.T) {
|
||||
|
||||
testTime := time.Date(2022, 1, 1, 0, 0, 0, 0, time.UTC)
|
||||
actual := gtr.JUnit(gtr.FromEvents(events, packageName), "hostname", testTime)
|
||||
// Remove any new properties for backwards compatibility
|
||||
actual = dropNewProperties(actual)
|
||||
|
||||
expectedXML, err := loadTestReport(reportFile, "")
|
||||
if err != nil {
|
||||
@ -242,20 +240,6 @@ func modifyForBackwardsCompat(testsuites junit.Testsuites) junit.Testsuites {
|
||||
return testsuites
|
||||
}
|
||||
|
||||
func dropNewProperties(testsuites junit.Testsuites) junit.Testsuites {
|
||||
for i, suite := range testsuites.Suites {
|
||||
if suite.Properties == nil {
|
||||
continue
|
||||
}
|
||||
ps := suite.Properties
|
||||
ps = dropProperty("goos", ps)
|
||||
ps = dropProperty("goarch", ps)
|
||||
ps = dropProperty("pkg", ps)
|
||||
testsuites.Suites[i].Properties = ps
|
||||
}
|
||||
return testsuites
|
||||
}
|
||||
|
||||
func dropProperty(name string, properties *[]junit.Property) *[]junit.Property {
|
||||
if properties == nil {
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user