Commit 170962be authored by Jeff Grafton's avatar Jeff Grafton

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

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