Merge pull request #1741 from thaJeztah/18.09_backport_fix_plugin_test

[18.09 backport] Fix: plugin-tests discarding current environment
This commit is contained in:
Silvin Lubecki 2019-03-18 14:47:32 +01:00 committed by GitHub
commit e63ac0ea35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -106,7 +106,7 @@ func ensureBasicPluginBin() (string, error) {
}
installPath := filepath.Join(os.Getenv("GOPATH"), "bin", name)
cmd := exec.Command(goBin, "build", "-o", installPath, "./basic")
cmd.Env = append(cmd.Env, "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))
}

View File

@ -69,6 +69,7 @@ function runtests {
TEST_SKIP_PLUGIN_TESTS="${SKIP_PLUGIN_TESTS-}" \
GOPATH="$GOPATH" \
PATH="$PWD/build/:/usr/bin" \
HOME="$HOME" \
"$(which go)" test -v ./e2e/... ${TESTFLAGS-}
}