Skip to content

Commit

Permalink
fix: fix test leaking file
Browse files Browse the repository at this point in the history
  • Loading branch information
sreya committed Nov 27, 2024
1 parent 9db34a0 commit bc946cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions integration/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,9 @@ func TestDocker(t *testing.T) {
HostKeyPath: regKeyPath,
Image: integrationtest.UbuntuImage,
TLSPort: strconv.Itoa(registryAddr.Port),
PasswordDir: dir,
Username: "user",
Password: "password",
})

envs := []string{
Expand Down
2 changes: 1 addition & 1 deletion integration/integrationtest/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TmpDir(t *testing.T) string {
// We use os.MkdirTemp as oposed to t.TempDir since the envbox container will
// chown some of the created directories here to root:root causing the cleanup
// function to fail once the test exits.
tmpdir, err := os.MkdirTemp(os.TempDir(), strings.ReplaceAll(t.Name(), "/", "_"))
tmpdir, err := os.MkdirTemp("", strings.ReplaceAll(t.Name(), "/", "_"))
require.NoError(t, err)
t.Logf("using tmpdir %s", tmpdir)
t.Cleanup(func() {
Expand Down

0 comments on commit bc946cf

Please sign in to comment.