From 605ea666c6d04d70ab990fbb169b6f09c400e8a9 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 5 Dec 2022 13:02:13 +0100 Subject: [PATCH] fix: stop creating `data` folder when running tests (#14152) --- simapp/test_helpers.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/simapp/test_helpers.go b/simapp/test_helpers.go index d59f8b56305a..402e8c014f1d 100644 --- a/simapp/test_helpers.go +++ b/simapp/test_helpers.go @@ -2,6 +2,8 @@ package simapp import ( "encoding/json" + "fmt" + "os" "testing" "github.com/stretchr/testify/require" @@ -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(