Skip to content

Commit

Permalink
robustness: Add option to not overwrite results dir.
Browse files Browse the repository at this point in the history
Signed-off-by: Siyuan Zhang <[email protected]>
  • Loading branch information
siyuanfoundation committed Apr 19, 2024
1 parent e246bb8 commit 64b338a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/robustness/report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"path/filepath"
"strings"
"testing"
"time"

"go.uber.org/zap"

Expand All @@ -46,6 +47,10 @@ func testResultsDirectory(t *testing.T) string {
if err != nil {
t.Fatal(err)
}
overwriteResultsDir, ok := os.LookupEnv("OVERWRITE_RESULTS_DIR")
if ok && overwriteResultsDir == "false" {
path = filepath.Join(path, fmt.Sprintf("%v", time.Now().UnixNano()))
}
err = os.RemoveAll(path)
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 64b338a

Please sign in to comment.