integration: ensurePlugin: disable go modules when building plugin

=== RUN   TestServicePlugin
        plugin_test.go:42: assertion failed: error is not nil: error building basic plugin bin: no required module provides package github.com/docker/docker/testutil/fixtures/plugin/basic: go.mod file not found in current directory or any parent directory; see 'go help modules'
            : exit status 1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7070df3a3e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2021-05-17 14:12:49 +02:00
parent 09a7efb1f7
commit 8b0913935c
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
3 changed files with 3 additions and 3 deletions

View file

@ -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)))
}

View file

@ -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)))
}

View file

@ -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))
}