Skip to content

Commit

Permalink
Nuke persistent storage on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
kegsay committed Feb 26, 2024
1 parent 4de9f7b commit 9780733
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package tests

import (
"fmt"
"os"
"sync"
"testing"

Expand All @@ -25,6 +26,13 @@ var (
func TestMain(m *testing.M) {
complementCryptoConfig = config.NewComplementCryptoConfigFromEnvVars()
ssMutex = &sync.Mutex{}

// nuke persistent storage from previous run. We do this on startup rather than teardown
// to allow devs to introspect DBs / Chrome profiles if tests fail.
// TODO: ideally client packages would do this.
os.RemoveAll("./rust_storage")
os.RemoveAll("./chromedp")

js.SetupJSLogs("./logs/js_sdk.log") // rust sdk logs on its own
complement.TestMainWithCleanup(m, "crypto", func() { // always teardown even if panicking
ssMutex.Lock()
Expand Down

0 comments on commit 9780733

Please sign in to comment.