Skip to content

Commit 71f4d4d

Browse files
committed
Use isolated temp directory for VM detection tests
1 parent b92f20a commit 71f4d4d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

internal/runtime/docker_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ func TestSocketPath_ReturnsEmptyForTCPHost(t *testing.T) {
7171
}
7272

7373
func TestSocketPath_VMDetection(t *testing.T) {
74-
home, err := os.UserHomeDir()
75-
require.NoError(t, err)
74+
home := t.TempDir()
75+
t.Setenv("HOME", home)
7676

7777
t.Run("colima socket exists returns remapped path", func(t *testing.T) {
7878
colimaSock := filepath.Join(home, ".colima", "default", "docker.sock")

0 commit comments

Comments
 (0)