Explicitly log how long each step of e2e setup/test/teardown takes.

This commit is contained in:
Jeff Grafton 2015-09-15 15:03:34 -07:00
parent f03a267089
commit 170962becb

View File

@ -31,6 +31,7 @@ import (
"path/filepath"
"strconv"
"strings"
"time"
)
var (
@ -84,6 +85,7 @@ type TestResult struct {
type ResultsByTest map[string]TestResult
func main() {
log.SetFlags(log.LstdFlags | log.Lshortfile)
flag.Parse()
if *isup {
@ -297,6 +299,10 @@ func finishRunning(stepName string, cmd *exec.Cmd) bool {
cmd.Stderr = os.Stderr
}
log.Printf("Running: %v", stepName)
defer func(start time.Time) {
log.Printf("Step '%s' finished in %s", stepName, time.Since(start))
}(time.Now())
if err := cmd.Run(); err != nil {
log.Printf("Error running %v: %v", stepName, err)
return false