Skip to content

Commit

Permalink
test(client/keys): Test_runImportCmd unique dir per test (#17863)
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianToledano authored Sep 25, 2023
1 parent fb3f61b commit 2b22254
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/keys/import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ HbP+c6JmeJy9JXe2rbbF1QtCX1gLqGcDQPBXiCtFvP7/8wTZtVOPj8vREzhZ9ElO
mockIn := testutil.ApplyMockIODiscardOutErr(cmd)

// Now add a temporary keybase
kbHome := t.TempDir()
kbHome := filepath.Join(t.TempDir(), fmt.Sprintf("kbhome-%s", tc.name))
// Create dir, otherwise os.WriteFile will fail
if _, err := os.Stat(kbHome); os.IsNotExist(err) {
err = os.MkdirAll(kbHome, 0o700)
require.NoError(t, err)
}
kb, err := keyring.New(sdk.KeyringServiceName(), tc.keyringBackend, kbHome, nil, cdc)
require.NoError(t, err)

Expand Down

0 comments on commit 2b22254

Please sign in to comment.