Merge pull request #158 from thaJeztah/18.09_backport_save_the_environment
[18.09 backport] Fix: plugin-tests discarding current environment Upstream-commit: 5c15222f0f9381fad6d27dc1374ed2af417d16f7 Component: engine
This commit is contained in:
@@ -31,7 +31,7 @@ func ensurePlugin(t *testing.T, name string) string {
|
||||
}
|
||||
|
||||
cmd := exec.Command(goBin, "build", "-o", installPath, "./"+filepath.Join("cmd", name))
|
||||
cmd.Env = append(cmd.Env, "CGO_ENABLED=0")
|
||||
cmd.Env = append(os.Environ(), "CGO_ENABLED=0")
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
t.Fatal(errors.Wrapf(err, "error building basic plugin bin: %s", string(out)))
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ func ensurePlugin(t *testing.T, name string) string {
|
||||
}
|
||||
|
||||
cmd := exec.Command(goBin, "build", "-o", installPath, "./"+filepath.Join("cmd", name))
|
||||
cmd.Env = append(cmd.Env, "CGO_ENABLED=0")
|
||||
cmd.Env = append(os.Environ(), "CGO_ENABLED=0")
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
t.Fatal(errors.Wrapf(err, "error building basic plugin bin: %s", string(out)))
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ func ensureBasicPluginBin() (string, error) {
|
||||
installPath := filepath.Join(os.Getenv("GOPATH"), "bin", name)
|
||||
sourcePath := filepath.Join("github.com", "docker", "docker", "internal", "test", "fixtures", "plugin", "basic")
|
||||
cmd := exec.Command(goBin, "build", "-o", installPath, sourcePath)
|
||||
cmd.Env = append(cmd.Env, "GOPATH="+os.Getenv("GOPATH"), "CGO_ENABLED=0")
|
||||
cmd.Env = append(os.Environ(), "CGO_ENABLED=0")
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
return "", errors.Wrapf(err, "error building basic plugin bin: %s", string(out))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user