aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modfetch/coderepo_test.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2019-05-10 15:26:56 -0400
committerBryan C. Mills <bcmills@google.com>2019-05-13 17:15:46 +0000
commit5f320f962bd79120f542315c8317f3469c47cee3 (patch)
tree9bab101bac2a3918191515791d1b450e70aa5a5d /src/cmd/go/internal/modfetch/coderepo_test.go
parentdb2bf154cc06fe67c79164f225592b06660fa02c (diff)
downloadgo-5f320f962bd79120f542315c8317f3469c47cee3.tar.gz
go-5f320f962bd79120f542315c8317f3469c47cee3.zip
cmd/go/internal/modfetch: fix GOSUMDB test failures
Use cfg.GOSUMDB consistently instead of re-resolving it from the environment. Set cfg.GOSUMDB to 'off' explicitly in coderepo_test, since it may include modules that cannot be fetched using a released version of the 'go' command. Fixes #31964 Change-Id: I17cae9e0c6aa1168ba534e6da4e3652800ac81e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/176538 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/internal/modfetch/coderepo_test.go')
-rw-r--r--src/cmd/go/internal/modfetch/coderepo_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cmd/go/internal/modfetch/coderepo_test.go b/src/cmd/go/internal/modfetch/coderepo_test.go
index fcea6a0c1b0..724602233c5 100644
--- a/src/cmd/go/internal/modfetch/coderepo_test.go
+++ b/src/cmd/go/internal/modfetch/coderepo_test.go
@@ -16,6 +16,7 @@ import (
"testing"
"time"
+ "cmd/go/internal/cfg"
"cmd/go/internal/modfetch/codehost"
)
@@ -26,6 +27,12 @@ func TestMain(m *testing.M) {
func testMain(m *testing.M) int {
SetProxy("direct")
+ // The sum database is populated using a released version of the go command,
+ // but this test may include fixes for additional modules that previously
+ // could not be fetched. Since this test isn't executing any of the resolved
+ // code, bypass the sum database.
+ cfg.GOSUMDB = "off"
+
dir, err := ioutil.TempDir("", "gitrepo-test-")
if err != nil {
log.Fatal(err)