mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #42391 from thaJeztah/nomod
Disable go modules when compiling binaries used in tests
This commit is contained in:
commit
a6e51a7aee
4 changed files with 4 additions and 3 deletions
|
@ -874,6 +874,7 @@ Try {
|
|||
} else {
|
||||
$env:DOCKER_HOST=$DASHH_CUT
|
||||
$env:PATH="$env:TEMP\binary;$env:PATH;" # Force to use the test binaries, not the host ones.
|
||||
$env:GO111MODULE="off"
|
||||
Write-Host -ForegroundColor Green "INFO: DOCKER_HOST at $DASHH_CUT"
|
||||
|
||||
$ErrorActionPreference = "SilentlyContinue"
|
||||
|
|
|
@ -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(os.Environ(), "CGO_ENABLED=0")
|
||||
cmd.Env = append(os.Environ(), "CGO_ENABLED=0", "GO111MODULE=off")
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
t.Fatal(errors.Wrapf(err, "error building basic plugin bin: %s", string(out)))
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ func ensurePlugin(t *testing.T, name string) string {
|
|||
assert.NilError(t, err)
|
||||
|
||||
cmd := exec.Command(goBin, "build", "-o", installPath, "./"+filepath.Join("cmd", name))
|
||||
cmd.Env = append(os.Environ(), "CGO_ENABLED=0")
|
||||
cmd.Env = append(os.Environ(), "CGO_ENABLED=0", "GO111MODULE=off")
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
t.Fatal(errors.Wrapf(err, "error building basic plugin bin: %s", string(out)))
|
||||
}
|
||||
|
|
|
@ -222,7 +222,7 @@ func ensureBasicPluginBin() (string, error) {
|
|||
installPath := filepath.Join(os.Getenv("GOPATH"), "bin", name)
|
||||
sourcePath := filepath.Join("github.com", "docker", "docker", "testutil", "fixtures", "plugin", "basic")
|
||||
cmd := exec.Command(goBin, "build", "-o", installPath, sourcePath)
|
||||
cmd.Env = append(os.Environ(), "CGO_ENABLED=0")
|
||||
cmd.Env = append(os.Environ(), "CGO_ENABLED=0", "GO111MODULE=off")
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
return "", errors.Wrapf(err, "error building basic plugin bin: %s", string(out))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue