From 8bae2278ba79a4bd37841edd204b9399638e65d9 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 17 May 2021 15:24:53 +0200 Subject: [PATCH 1/2] hack/ci/windows.ps1: disable go modules INFO: Running integration tests at 05/17/2021 12:54:50... INFO: DOCKER_HOST at tcp://127.0.0.1:2357 INFO: Integration API tests being run from the host: INFO: make.ps1 starting at 05/17/2021 12:54:50 powershell.exe : go: cannot find main module, but found vendor.conf in D:\gopath\src\github.com\docker\docker At D:\gopath\src\github.com\docker\docker@tmp\durable-1ed00396\powershellWrapper.ps1:3 char:1 + & powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Comm ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (go: cannot find...m\docker\docker:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError to create a module there, run: go mod init INFO: make.ps1 ended at 05/17/2021 12:54:51 Signed-off-by: Sebastiaan van Stijn --- hack/ci/windows.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/hack/ci/windows.ps1 b/hack/ci/windows.ps1 index fe166e9bb7..bc58bd858b 100644 --- a/hack/ci/windows.ps1 +++ b/hack/ci/windows.ps1 @@ -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" From 7070df3a3e4f668c10b7c8527b15e93926214244 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 17 May 2021 14:12:49 +0200 Subject: [PATCH 2/2] 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 --- integration/plugin/logging/helpers_test.go | 2 +- integration/plugin/volumes/helpers_test.go | 2 +- testutil/fixtures/plugin/plugin.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/integration/plugin/logging/helpers_test.go b/integration/plugin/logging/helpers_test.go index f37d7aa94b..7a9f146c9d 100644 --- a/integration/plugin/logging/helpers_test.go +++ b/integration/plugin/logging/helpers_test.go @@ -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))) } diff --git a/integration/plugin/volumes/helpers_test.go b/integration/plugin/volumes/helpers_test.go index 953ed0a584..96cefead92 100644 --- a/integration/plugin/volumes/helpers_test.go +++ b/integration/plugin/volumes/helpers_test.go @@ -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))) } diff --git a/testutil/fixtures/plugin/plugin.go b/testutil/fixtures/plugin/plugin.go index 88f1bd9b3a..4a89a6c4e9 100644 --- a/testutil/fixtures/plugin/plugin.go +++ b/testutil/fixtures/plugin/plugin.go @@ -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)) }