mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +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()
|
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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user