junit: Use the timestamp from the gtr.Report when creating Testsuites

This commit is contained in:
Joël Stemmer
2022-03-15 19:44:26 +00:00
parent b0a9864d1e
commit 4b87b03e55
3 changed files with 15 additions and 11 deletions

View File

@ -127,16 +127,17 @@ type Output struct {
}
// CreateFromReport creates a JUnit representation of the given gtr.Report.
func CreateFromReport(report gtr.Report, hostname string, timestamp time.Time) Testsuites {
ts := timestamp.Format(time.RFC3339)
func CreateFromReport(report gtr.Report, hostname string) Testsuites {
var suites Testsuites
for _, pkg := range report.Packages {
var duration time.Duration
suite := Testsuite{
Name: pkg.Name,
Timestamp: ts,
Hostname: hostname,
Name: pkg.Name,
Hostname: hostname,
}
if !pkg.Timestamp.IsZero() {
suite.SetTimestamp(pkg.Timestamp)
}
for k, v := range pkg.Properties {