diff --git a/go/cmd/dolt/commands/batsee.go b/go/cmd/dolt/commands/batsee.go index 3af4391cfc..3ba6becd4e 100644 --- a/go/cmd/dolt/commands/batsee.go +++ b/go/cmd/dolt/commands/batsee.go @@ -27,6 +27,7 @@ import ( "os/exec" "path/filepath" "sync" + "time" ) var batseeDoc = cli.CommandDocumentationContent{ @@ -67,9 +68,9 @@ func (b BatseeCmd) RequiresRepo() bool { } type batsResult struct { - // Duration would be nice too. - path string - err error + runtime time.Duration + path string + err error } func (b BatseeCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv, cliCtx cli.CliContext) int { @@ -132,10 +133,7 @@ func (b BatseeCmd) Exec(ctx context.Context, commandStr string, args []string, d exitStatus := 0 for result := range results { - if result.err != nil { - cli.Println("Error running bats test:", result.path, result.err.Error()) - exitStatus = 1 - } + cli.Println(fmt.Sprintf("Test %s completed in %s", result.path, result.runtime.String())) } return exitStatus } @@ -154,6 +152,8 @@ func runBats(path string, resultChan chan<- batsResult) { result := batsResult{path: path} + startTime := time.Now() + outPath := fmt.Sprintf("batsee_results/%s.stdout.log", path) output, err := os.Create(outPath) if err != nil { @@ -198,6 +198,7 @@ func runBats(path string, resultChan chan<- batsResult) { result.err = err } + result.runtime = time.Since(startTime) resultChan <- result return }