diff --git a/cmd/go2junit/go2junit.go b/cmd/go2junit/go2junit.go index 1125ab9..41645d2 100644 --- a/cmd/go2junit/go2junit.go +++ b/cmd/go2junit/go2junit.go @@ -5,6 +5,7 @@ import ( "encoding/json" "encoding/xml" "fmt" + "log" "os" "path/filepath" "strings" @@ -29,6 +30,7 @@ func (t *Test) MarshalXML(e *xml.Encoder, start xml.StartElement) error { Message: "failed", } } + log.Printf("TIME %f", t.Time) parts := strings.Split(t.Name, "/") tc := Testcase{ Name: parts[len(parts)-1], diff --git a/cmd/go2junit/output.go b/cmd/go2junit/output.go index 437a5aa..c9c3d69 100644 --- a/cmd/go2junit/output.go +++ b/cmd/go2junit/output.go @@ -140,6 +140,8 @@ func (testsuites *Testsuites) Pass(t time.Time, pkg string, test string, elapsed if testsuites.getRootSuite(t, pkg+"/"+test, false) != nil { return } + tc := testsuites.getTest(t, pkg, test) + tc.Time = elapsed } func (testsuites *Testsuites) Bench(t time.Time, pkg string, test string, output string, elapsed float64) {