gtr: Set hostname and timestamp fields when creating JUnit Testsuite

Fixes #117
This commit is contained in:
Joël Stemmer 2022-02-27 21:34:11 +00:00
parent c3acdf13c2
commit 2ece8eae1a
36 changed files with 60 additions and 48 deletions

View File

@ -5,6 +5,7 @@ import (
"flag" "flag"
"fmt" "fmt"
"os" "os"
"time"
"github.com/jstemmer/go-junit-report/v2/pkg/gtr" "github.com/jstemmer/go-junit-report/v2/pkg/gtr"
"github.com/jstemmer/go-junit-report/v2/pkg/parser/gotest" "github.com/jstemmer/go-junit-report/v2/pkg/parser/gotest"
@ -55,13 +56,16 @@ func main() {
} }
report := gtr.FromEvents(events, *packageName) report := gtr.FromEvents(events, *packageName)
hostname, _ := os.Hostname() // ignore error
testsuites := gtr.JUnit(report, hostname, time.Now())
if !*noXMLHeader { if !*noXMLHeader {
fmt.Fprintf(os.Stdout, xml.Header) fmt.Fprintf(os.Stdout, xml.Header)
} }
enc := xml.NewEncoder(os.Stdout) enc := xml.NewEncoder(os.Stdout)
enc.Indent("", "\t") enc.Indent("", "\t")
if err := enc.Encode(gtr.JUnit(report)); err != nil { if err := enc.Encode(testsuites); err != nil {
fmt.Fprintf(os.Stderr, "Error writing XML: %s\n", err) fmt.Fprintf(os.Stderr, "Error writing XML: %s\n", err)
os.Exit(1) os.Exit(1)
} }

View File

@ -11,6 +11,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"testing" "testing"
"time"
"github.com/jstemmer/go-junit-report/v2/pkg/gtr" "github.com/jstemmer/go-junit-report/v2/pkg/gtr"
"github.com/jstemmer/go-junit-report/v2/pkg/junit" "github.com/jstemmer/go-junit-report/v2/pkg/junit"
@ -198,7 +199,8 @@ func testReport(input, reportFile, packageName string, t *testing.T) {
} }
} }
actual := gtr.JUnit(gtr.FromEvents(events, packageName)) 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 // Remove any new properties for backwards compatibility
actual = dropNewProperties(actual) actual = dropNewProperties(actual)

View File

@ -103,11 +103,17 @@ func FromEvents(events []Event, packageName string) Report {
} }
// JUnit converts the given report to a collection of JUnit Testsuites. // JUnit converts the given report to a collection of JUnit Testsuites.
func JUnit(report Report) junit.Testsuites { func JUnit(report Report, hostname string, now time.Time) junit.Testsuites {
timestamp := now.Format(time.RFC3339)
var suites junit.Testsuites var suites junit.Testsuites
for _, pkg := range report.Packages { for _, pkg := range report.Packages {
var duration time.Duration var duration time.Duration
suite := junit.Testsuite{Name: pkg.Name} suite := junit.Testsuite{
Name: pkg.Name,
Timestamp: timestamp,
Hostname: hostname,
}
if pkg.Coverage > 0 { if pkg.Coverage > 0 {
suite.AddProperty("coverage.statements.pct", fmt.Sprintf("%.2f", pkg.Coverage)) suite.AddProperty("coverage.statements.pct", fmt.Sprintf("%.2f", pkg.Coverage))

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2"> <testsuites tests="2">
<testsuite tests="2" failures="0" time="0.160" name="package/name"> <testsuite tests="2" failures="0" time="0.160" name="package/name" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2" failures="1"> <testsuites tests="2" failures="1">
<testsuite tests="2" failures="1" time="0.151" name="package/name"> <testsuite tests="2" failures="1" time="0.151" name="package/name" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2"> <testsuites tests="2">
<testsuite tests="2" failures="0" time="0.150" name="package/name"> <testsuite tests="2" failures="0" time="0.150" name="package/name" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2"> <testsuites tests="2">
<testsuite tests="2" failures="0" time="0.160" name="package/name"> <testsuite tests="2" failures="0" time="0.160" name="package/name" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,5 +1,5 @@
<testsuites tests="2"> <testsuites tests="2">
<testsuite tests="2" failures="0" time="0.160" name="package/name"> <testsuite tests="2" failures="0" time="0.160" name="package/name" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,5 +1,5 @@
<testsuites tests="4" failures="1"> <testsuites tests="4" failures="1">
<testsuite tests="2" failures="0" time="0.160" name="package/name1"> <testsuite tests="2" failures="0" time="0.160" name="package/name1" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2"> <testsuites tests="2">
<testsuite tests="2" failures="0" time="0.160" name="test/package"> <testsuite tests="2" failures="0" time="0.160" name="test/package" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2"> <testsuites tests="2">
<testsuite tests="2" failures="0" time="0.440" name="package/name"> <testsuite tests="2" failures="0" time="0.440" name="package/name" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2"> <testsuites tests="2">
<testsuite tests="2" failures="0" time="0.160" name="package/name"> <testsuite tests="2" failures="0" time="0.160" name="package/name" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
<property name="coverage.statements.pct" value="13.37"></property> <property name="coverage.statements.pct" value="13.37"></property>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="3"> <testsuites tests="3">
<testsuite tests="2" failures="0" time="0.400" name="package1/foo"> <testsuite tests="2" failures="0" time="0.400" name="package1/foo" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
<property name="coverage.statements.pct" value="10.00"></property> <property name="coverage.statements.pct" value="10.00"></property>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2"> <testsuites tests="2">
<testsuite tests="2" failures="0" time="0.050" name="package/name"> <testsuite tests="2" failures="0" time="0.050" name="package/name" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="18" failures="3" skipped="2"> <testsuites tests="18" failures="3" skipped="2">
<testsuite tests="18" failures="3" time="0.050" name="package/name"> <testsuite tests="18" failures="3" time="0.050" name="package/name" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="5" errors="3"> <testsuites tests="5" errors="3">
<testsuite tests="1" failures="0" time="0.100" name="package/name/passing1"> <testsuite tests="1" failures="0" time="0.100" name="package/name/passing1" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>
<testcase classname="passing1" name="TestA" time="0.100"></testcase> <testcase classname="passing1" name="TestA" time="0.100"></testcase>
</testsuite> </testsuite>
<testsuite tests="1" failures="0" time="0.100" name="package/name/passing2"> <testsuite tests="1" failures="0" time="0.100" name="package/name/passing2" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>
<testcase classname="passing2" name="TestB" time="0.100"></testcase> <testcase classname="passing2" name="TestB" time="0.100"></testcase>
</testsuite> </testsuite>
<testsuite tests="1" failures="1" time="0.000" name="package/name/failing1"> <testsuite tests="1" failures="1" time="0.000" name="package/name/failing1" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>
@ -20,7 +20,7 @@
<failure message="Failed" type="">failing1/failing_test.go:15: undefined: x</failure> <failure message="Failed" type="">failing1/failing_test.go:15: undefined: x</failure>
</testcase> </testcase>
</testsuite> </testsuite>
<testsuite tests="1" failures="1" time="0.000" name="package/name/failing2"> <testsuite tests="1" failures="1" time="0.000" name="package/name/failing2" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>
@ -28,7 +28,7 @@
<failure message="Failed" type="">failing2/another_failing_test.go:20: undefined: y</failure> <failure message="Failed" type="">failing2/another_failing_test.go:20: undefined: y</failure>
</testcase> </testcase>
</testsuite> </testsuite>
<testsuite tests="1" failures="1" time="0.000" name="package/name/setupfailing1"> <testsuite tests="1" failures="1" time="0.000" name="package/name/setupfailing1" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2" errors="2"> <testsuites tests="2" errors="2">
<testsuite tests="1" failures="1" time="0.003" name="package/panic"> <testsuite tests="1" failures="1" time="0.003" name="package/panic" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>
@ -8,7 +8,7 @@
<failure message="Failed" type="">panic: init&#xA;stacktrace</failure> <failure message="Failed" type="">panic: init&#xA;stacktrace</failure>
</testcase> </testcase>
</testsuite> </testsuite>
<testsuite tests="1" failures="1" time="0.003" name="package/panic2"> <testsuite tests="1" failures="1" time="0.003" name="package/panic2" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites> <testsuites>
<testsuite tests="0" failures="0" time="0.001" name="package/empty"> <testsuite tests="0" failures="0" time="0.001" name="package/empty" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="3"> <testsuites tests="3">
<testsuite tests="3" failures="0" time="0.001" name="package/repeated-names"> <testsuite tests="3" failures="0" time="0.001" name="package/repeated-names" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="1" failures="1"> <testsuites tests="1" failures="1">
<testsuite tests="1" failures="1" time="0.015" name="race_test"> <testsuite tests="1" failures="1" time="0.015" name="race_test" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="3"> <testsuites tests="3">
<testsuite tests="2" failures="0" time="0.400" name="package1/foo"> <testsuite tests="2" failures="0" time="0.400" name="package1/foo" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
<property name="coverage.statements.pct" value="10.00"></property> <property name="coverage.statements.pct" value="10.00"></property>
@ -8,7 +8,7 @@
<testcase classname="foo" name="TestA" time="0.100"></testcase> <testcase classname="foo" name="TestA" time="0.100"></testcase>
<testcase classname="foo" name="TestB" time="0.300"></testcase> <testcase classname="foo" name="TestB" time="0.300"></testcase>
</testsuite> </testsuite>
<testsuite tests="1" failures="0" time="4.200" name="package2/bar"> <testsuite tests="1" failures="0" time="4.200" name="package2/bar" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
<property name="coverage.statements.pct" value="99.80"></property> <property name="coverage.statements.pct" value="99.80"></property>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2"> <testsuites tests="2">
<testsuite tests="2" failures="0" time="0.160" name="package/name"> <testsuite tests="2" failures="0" time="0.160" name="package/name" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="3" failures="3"> <testsuites tests="3" failures="3">
<testsuite tests="3" failures="3" time="3.010" name="pkg/parallel"> <testsuite tests="3" failures="3" time="3.010" name="pkg/parallel" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="1"> <testsuites tests="1">
<testsuite tests="1" failures="0" time="0.000" name="package/one"> <testsuite tests="1" failures="0" time="0.000" name="package/one" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2"> <testsuites tests="2">
<testsuite tests="2" failures="0" time="3.212" name="package/basic"> <testsuite tests="2" failures="0" time="3.212" name="package/basic" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2"> <testsuites tests="2">
<testsuite tests="2" failures="0" time="9.415" name="package/one"> <testsuite tests="2" failures="0" time="9.415" name="package/one" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="6"> <testsuites tests="6">
<testsuite tests="6" failures="0" time="1.382" name="package3/baz"> <testsuite tests="6" failures="0" time="1.382" name="package3/baz" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2"> <testsuites tests="2">
<testsuite tests="2" failures="0" time="14.211" name="pkg/count"> <testsuite tests="2" failures="0" time="14.211" name="pkg/count" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="6"> <testsuites tests="6">
<testsuite tests="2" failures="0" time="7.267" name="mycode/common"> <testsuite tests="2" failures="0" time="7.267" name="mycode/common" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>
<testcase classname="common" name="BenchmarkParse" time="0.000001591"></testcase> <testcase classname="common" name="BenchmarkParse" time="0.000001591"></testcase>
<testcase classname="common" name="BenchmarkNewTask" time="0.000000391"></testcase> <testcase classname="common" name="BenchmarkNewTask" time="0.000000391"></testcase>
</testsuite> </testsuite>
<testsuite tests="4" failures="0" time="47.084" name="mycode/benchmarks/channels"> <testsuite tests="4" failures="0" time="47.084" name="mycode/benchmarks/channels" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="3"> <testsuites tests="3">
<testsuite tests="3" failures="0" time="4.344" name="really/small"> <testsuite tests="3" failures="0" time="4.344" name="really/small" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="1"> <testsuites tests="1">
<testsuite tests="1" failures="0" time="9.467" name="single/cpu"> <testsuite tests="1" failures="0" time="9.467" name="single/cpu" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="1"> <testsuites tests="1">
<testsuite tests="1" failures="0" time="1.522" name="sixteen/cpu"> <testsuite tests="1" failures="0" time="1.522" name="sixteen/cpu" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="17" failures="9"> <testsuites tests="17" failures="9">
<testsuite tests="17" failures="9" time="4.567" name="package/name1"> <testsuite tests="17" failures="9" time="4.567" name="package/name1" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="5" errors="3"> <testsuites tests="5" errors="3">
<testsuite tests="1" failures="0" time="0.100" name="package/name/passing1"> <testsuite tests="1" failures="0" time="0.100" name="package/name/passing1" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>
<testcase classname="passing1" name="TestA" time="0.100"></testcase> <testcase classname="passing1" name="TestA" time="0.100"></testcase>
</testsuite> </testsuite>
<testsuite tests="1" failures="0" time="0.100" name="package/name/passing2"> <testsuite tests="1" failures="0" time="0.100" name="package/name/passing2" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>
<testcase classname="passing2" name="TestB" time="0.100"></testcase> <testcase classname="passing2" name="TestB" time="0.100"></testcase>
</testsuite> </testsuite>
<testsuite tests="1" failures="1" time="0.000" name="package/name/failing1"> <testsuite tests="1" failures="1" time="0.000" name="package/name/failing1" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>
@ -20,7 +20,7 @@
<failure message="Failed" type="">failing1/failing_test.go:15: undefined: x</failure> <failure message="Failed" type="">failing1/failing_test.go:15: undefined: x</failure>
</testcase> </testcase>
</testsuite> </testsuite>
<testsuite tests="1" failures="1" time="0.000" name="package/name/failing2"> <testsuite tests="1" failures="1" time="0.000" name="package/name/failing2" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>
@ -28,7 +28,7 @@
<failure message="Failed" type="">failing2/another_failing_test.go:20: undefined: y</failure> <failure message="Failed" type="">failing2/another_failing_test.go:20: undefined: y</failure>
</testcase> </testcase>
</testsuite> </testsuite>
<testsuite tests="1" failures="1" time="0.000" name="package/name/setupfailing1"> <testsuite tests="1" failures="1" time="0.000" name="package/name/setupfailing1" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2" errors="1"> <testsuites tests="2" errors="1">
<testsuite tests="2" failures="1" time="0.005" name="github.com/jstemmer/test/failedsummary"> <testsuite tests="2" failures="1" time="0.005" name="github.com/jstemmer/test/failedsummary" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2"> <testsuites tests="2">
<testsuite tests="2" failures="0" time="83.202" name="compress/flate"> <testsuite tests="2" failures="0" time="83.202" name="compress/flate" hostname="hostname" timestamp="2022-01-01T00:00:00Z">
<properties> <properties>
<property name="go.version" value="1.0"></property> <property name="go.version" value="1.0"></property>
</properties> </properties>