test: use temporary folder in tests (#14246)
This commit is contained in:
+5
-5
@@ -44,7 +44,7 @@ func TestSimAppExportAndBlockedAddrs(t *testing.T) {
|
||||
app := NewSimappWithCustomOptions(t, false, SetupOptions{
|
||||
Logger: logger,
|
||||
DB: db,
|
||||
AppOpts: simtestutil.NewAppOptionsWithFlagHome(DefaultNodeHome),
|
||||
AppOpts: simtestutil.NewAppOptionsWithFlagHome(t.TempDir()),
|
||||
})
|
||||
|
||||
// BlockedAddresses returns a map of addresses in app v1 and a map of modules name in app v2.
|
||||
@@ -67,7 +67,7 @@ func TestSimAppExportAndBlockedAddrs(t *testing.T) {
|
||||
|
||||
logger2 := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
|
||||
// Making a new app object with the db, so that initchain hasn't been called
|
||||
app2 := NewSimApp(logger2, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(DefaultNodeHome))
|
||||
app2 := NewSimApp(logger2, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir()))
|
||||
_, err := app2.ExportAppStateAndValidators(false, []string{}, []string{})
|
||||
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
|
||||
}
|
||||
@@ -75,7 +75,7 @@ func TestSimAppExportAndBlockedAddrs(t *testing.T) {
|
||||
func TestRunMigrations(t *testing.T) {
|
||||
db := dbm.NewMemDB()
|
||||
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
|
||||
app := NewSimApp(logger, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(DefaultNodeHome))
|
||||
app := NewSimApp(logger, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir()))
|
||||
|
||||
// Create a new baseapp and configurator for the purpose of this test.
|
||||
bApp := baseapp.NewBaseApp(app.Name(), logger, db, app.TxConfig().TxDecoder())
|
||||
@@ -209,7 +209,7 @@ func TestRunMigrations(t *testing.T) {
|
||||
func TestInitGenesisOnMigration(t *testing.T) {
|
||||
db := dbm.NewMemDB()
|
||||
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
|
||||
app := NewSimApp(logger, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(DefaultNodeHome))
|
||||
app := NewSimApp(logger, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir()))
|
||||
ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()})
|
||||
|
||||
// Create a mock module. This module will serve as the new module we're
|
||||
@@ -255,7 +255,7 @@ func TestUpgradeStateOnGenesis(t *testing.T) {
|
||||
app := NewSimappWithCustomOptions(t, false, SetupOptions{
|
||||
Logger: logger,
|
||||
DB: db,
|
||||
AppOpts: simtestutil.NewAppOptionsWithFlagHome(DefaultNodeHome),
|
||||
AppOpts: simtestutil.NewAppOptionsWithFlagHome(t.TempDir()),
|
||||
})
|
||||
|
||||
// make sure the upgrade keeper has version map in state
|
||||
|
||||
Reference in New Issue
Block a user