fixed an issue with calculating durations

Этот коммит содержится в:
Fredrik Lönnblad 2020-01-19 13:46:15 -03:00
родитель 1a762a8938
коммит f988d266ed

Просмотреть файл

@ -122,20 +122,20 @@ func buildJUNITPackageSuite(suiteName string, startedAt time.Time, features []*f
suite := junitPackageSuite{ suite := junitPackageSuite{
Name: suiteName, Name: suiteName,
TestSuites: make([]*junitTestSuite, len(features)), TestSuites: make([]*junitTestSuite, len(features)),
Time: startedAt.Sub(timeNowFunc()).String(), Time: timeNowFunc().Sub(startedAt).String(),
} }
for idx, feat := range features { for idx, feat := range features {
ts := junitTestSuite{ ts := junitTestSuite{
Name: feat.Name, Name: feat.Name,
Time: feat.startedAt().Sub(feat.finishedAt()).String(), Time: feat.finishedAt().Sub(feat.startedAt()).String(),
TestCases: make([]*junitTestCase, len(feat.Scenarios)), TestCases: make([]*junitTestCase, len(feat.Scenarios)),
} }
for idx, scenario := range feat.Scenarios { for idx, scenario := range feat.Scenarios {
tc := junitTestCase{} tc := junitTestCase{}
tc.Name = scenario.Name tc.Name = scenario.Name
tc.Time = scenario.startedAt().Sub(scenario.finishedAt()).String() tc.Time = scenario.finishedAt().Sub(scenario.startedAt()).String()
ts.Tests++ ts.Tests++
suite.Tests++ suite.Tests++