소스 검색

tests.e2e: Fix Windows tests

Signed-off-by: Chris Crone <[email protected]>
Chris Crone 5 년 전
부모
커밋
6e99119a4b
1개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. 9 1
      tests/e2e/e2e_test.go

+ 9 - 1
tests/e2e/e2e_test.go

@@ -259,8 +259,16 @@ func TestMissingExistingCLI(t *testing.T) {
 	err = CopyFile(filepath.Join(binDir, DockerExecutableName), filepath.Join(bin, DockerExecutableName))
 	assert.NilError(t, err)
 
+	env := []string{"PATH=" + bin}
+	if runtime.GOOS == "windows" {
+		env = append(env, "USERPROFILE="+home)
+
+	} else {
+		env = append(env, "HOME="+home)
+	}
+
 	c := icmd.Cmd{
-		Env:     []string{"HOME=" + home, "PATH=" + bin},
+		Env:     env,
 		Command: []string{filepath.Join(bin, "docker")},
 	}
 	res := icmd.RunCmd(c)