Skip to content

Commit

Permalink
Overwrite home dir in additional test
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Kreitchman <[email protected]>
  • Loading branch information
bkreitch committed Nov 13, 2023
1 parent c6ce6df commit 39275e4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions hcvault/keysource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,14 @@ func Test_dataKeyFromSecret(t *testing.T) {

func Test_vaultClient(t *testing.T) {
t.Run("client", func(t *testing.T) {
tmpDir := t.TempDir()

// Reset before and after to make sure the override is taken into
// account, and restored after the test.
homedir.Reset()
t.Cleanup(func() { homedir.Reset() })
t.Setenv("VAULT_TOKEN", "")
t.Setenv("HOME", tmpDir)

got, err := vaultClient(testVaultAddress, "")
assert.NoError(t, err)
Expand Down

0 comments on commit 39275e4

Please sign in to comment.