@@ -49,23 +49,23 @@ func ParseTestResults(r io.Reader, verbose bool, env *ctrf.Environment) (*ctrf.R
49
49
report .Results .Tests = append (report .Results .Tests , & ctrf.TestResult {
50
50
Name : event .Test ,
51
51
Status : ctrf .TestPassed ,
52
- Duration : event .Elapsed ,
52
+ Duration : secondsToMillis ( event .Elapsed ) ,
53
53
})
54
54
} else if event .Action == "fail" {
55
55
report .Results .Summary .Tests ++
56
56
report .Results .Summary .Failed ++
57
57
report .Results .Tests = append (report .Results .Tests , & ctrf.TestResult {
58
58
Name : event .Test ,
59
59
Status : ctrf .TestFailed ,
60
- Duration : event .Elapsed ,
60
+ Duration : secondsToMillis ( event .Elapsed ) ,
61
61
})
62
62
} else if event .Action == "skip" {
63
63
report .Results .Summary .Tests ++
64
64
report .Results .Summary .Skipped ++
65
65
report .Results .Tests = append (report .Results .Tests , & ctrf.TestResult {
66
66
Name : event .Test ,
67
67
Status : ctrf .TestSkipped ,
68
- Duration : event .Elapsed ,
68
+ Duration : secondsToMillis ( event .Elapsed ) ,
69
69
})
70
70
}
71
71
}
@@ -83,3 +83,7 @@ func WriteReportToFile(filename string, report *ctrf.Report) error {
83
83
fmt .Println ("go-ctrf-json-reporter: successfully written ctrf json to" , filename )
84
84
return nil
85
85
}
86
+
87
+ func secondsToMillis (seconds float64 ) int64 {
88
+ return int64 (seconds * 1000 )
89
+ }
0 commit comments