Browse Source

Merge pull request #446 from docker/e2e-fix-windwows

Fix e2e tests on Windows
Guillaume Tardif 5 years ago
parent
commit
6405256752
1 changed files with 9 additions and 1 deletions
  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)