fix: stop creating data folder when running tests (#14152)

This commit is contained in:
Julien Robert 2022-12-05 13:02:13 +01:00 committed by GitHub
parent 390262f56b
commit 605ea666c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(