Skip to content

Commit

Permalink
fix: stop creating data folder when running tests (#14152)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Dec 5, 2022
1 parent 390262f commit 605ea66
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion simapp/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package simapp

import (
"encoding/json"
"fmt"
"os"
"testing"

"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -229,7 +231,13 @@ func ModuleAccountAddrs() map[string]bool {

// NewTestNetworkFixture returns a new simapp AppConstructor for network simulation tests
func NewTestNetworkFixture() network.TestFixture {
app := NewSimApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simtestutil.EmptyAppOptions{})
dir, err := os.MkdirTemp("", "simapp")
if err != nil {
panic(fmt.Sprintf("failed creating temporary directory: %v", err))
}
defer os.RemoveAll(dir)

app := NewSimApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simtestutil.NewAppOptionsWithFlagHome(dir))

appCtr := func(val testutil.Validator) servertypes.Application {
return NewSimApp(
Expand Down

0 comments on commit 605ea66

Please sign in to comment.