Create the batsee output directory if one doesn't exist yet.

Also adding the output directory to .gitignore.
This commit is contained in:
Pavel Safronov
2023-06-06 17:21:39 -07:00
parent 08370a172c
commit e85f8dbcf2
2 changed files with 12 additions and 0 deletions

1
.gitignore vendored
View File

@@ -14,3 +14,4 @@ SysbenchDockerfile
SysbenchDockerfile.dockerignore
sysbench-runner-tests-entrypoint.sh
config.json
integration-tests/bats/batsee_results

View File

@@ -313,6 +313,17 @@ func runBats(path string, resultChan chan<- batsResult, ctx context.Context, cfg
return
}
// ensure cfg.output exists, and create it if it doesn't
if _, err := os.Stat(cfg.output); os.IsNotExist(err) {
err = os.Mkdir(cfg.output, 0755)
if err != nil {
cli.Println("Error creating output directory:", err.Error())
result.err = err
resultChan <- result
return
}
}
startTime := time.Now()
outPath := fmt.Sprintf("%s/%s.stdout.log", cfg.output, path)