Commit 7ee633d1 authored by Zach Loafman's avatar Zach Loafman

Fix duration_ms output to seconds (_ms obviously means measure-in-seconds!?)

parent 7a0892da
...@@ -319,17 +319,20 @@ func Test() (results ResultsByTest) { ...@@ -319,17 +319,20 @@ func Test() (results ResultsByTest) {
start := time.Now() start := time.Now()
testResult := results[name] testResult := results[name]
res, stdout, stderr := runBashWithOutputs(name, absName) res, stdout, stderr := runBashWithOutputs(name, absName)
duration_ms := time.Now().Sub(start).Seconds() * 1000 // The duration_ms output is an undocumented Jenkins TAP
// plugin feature for test duration. One might think _ms means
// milliseconds, but Jenkins interprets this field in seconds.
duration_secs := time.Now().Sub(start).Seconds()
if res { if res {
fmt.Printf("ok %v - %v\n", i+1, name) fmt.Printf("ok %v - %v\n", i+1, name)
if *tap { if *tap {
fmt.Printf(" ---\n duration_ms: %.3f\n ...\n", duration_ms) fmt.Printf(" ---\n duration_ms: %.3f\n ...\n", duration_secs)
} }
testResult.Pass++ testResult.Pass++
} else { } else {
fmt.Printf("not ok %v - %v\n", i+1, name) fmt.Printf("not ok %v - %v\n", i+1, name)
if *tap { if *tap {
fmt.Printf(" ---\n duration_ms: %.3f\n", duration_ms) fmt.Printf(" ---\n duration_ms: %.3f\n", duration_secs)
} }
printBashOutputs(" ", " ", stdout, stderr) printBashOutputs(" ", " ", stdout, stderr)
if *tap { if *tap {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment