mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Fix duration_ms output to seconds (_ms obviously means measure-in-seconds!?)
This commit is contained in:
parent
7a0892dad8
commit
7ee633d186
@ -319,17 +319,20 @@ func Test() (results ResultsByTest) {
|
||||
start := time.Now()
|
||||
testResult := results[name]
|
||||
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 {
|
||||
fmt.Printf("ok %v - %v\n", i+1, name)
|
||||
if *tap {
|
||||
fmt.Printf(" ---\n duration_ms: %.3f\n ...\n", duration_ms)
|
||||
fmt.Printf(" ---\n duration_ms: %.3f\n ...\n", duration_secs)
|
||||
}
|
||||
testResult.Pass++
|
||||
} else {
|
||||
fmt.Printf("not ok %v - %v\n", i+1, name)
|
||||
if *tap {
|
||||
fmt.Printf(" ---\n duration_ms: %.3f\n", duration_ms)
|
||||
fmt.Printf(" ---\n duration_ms: %.3f\n", duration_secs)
|
||||
}
|
||||
printBashOutputs(" ", " ", stdout, stderr)
|
||||
if *tap {
|
||||
|
Loading…
Reference in New Issue
Block a user