Commit 54c6b814 authored by Bryan C. Mills's avatar Bryan C. Mills

cmd/go: fix TestScript/mod_sumdb_golang to avoid assumptions about @v/list

I accidentally fetched an invalid version of rsc.io/quote from
proxy.golang.org, which the proxy then cached and now includes in
https://proxy.golang.org/rsc.io/quote/@v/list.

That causes 'go get rsc.io/quote` to resolve to a different version
depending on whether the proxy is used.

Adjust the test to fetch an explicit version instead, since the choice
of 'latest' is mostly irrelevant to the checksum database logic that
the test is intended to verify.

Updates #32805
Fixes #32900

Change-Id: I075b1f62e8c71545d0fb2dd4bd77ba525fc2a36d
Reviewed-on: https://go-review.googlesource.com/c/go/+/184719
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: default avatarHyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent e62c3d35
...@@ -14,31 +14,39 @@ stdout '^sum.golang.org$' ...@@ -14,31 +14,39 @@ stdout '^sum.golang.org$'
[!exec:git] skip [!exec:git] skip
env GOSUMDB=sum.golang.org env GOSUMDB=sum.golang.org
env GOPROXY=direct env GOPROXY=direct
go get -d rsc.io/quote go get -d rsc.io/quote@v1.5.2
cp go.sum saved.sum
# download from proxy.golang.org with go.sum entry already # download from proxy.golang.org with go.sum entry already
go clean -modcache go clean -modcache
env GOSUMDB= env GOSUMDB=
env GOPROXY= env GOPROXY=
go get -x -d rsc.io/quote go get -x -d rsc.io/quote@v1.5.2
! stderr github ! stderr github
stderr proxy.golang.org/rsc.io/quote stderr proxy.golang.org/rsc.io/quote
! stderr sum.golang.org/tile ! stderr sum.golang.org/tile
! stderr sum.golang.org/lookup/rsc.io/quote ! stderr sum.golang.org/lookup/rsc.io/quote
cmp go.sum saved.sum
# download again, using checksum database to validate new go.sum lines # Download again.
# Should use the checksum database to validate new go.sum lines,
# but not need to fetch any new data from the proxy.
rm go.sum rm go.sum
go get -x -d rsc.io/quote go get -x -d rsc.io/quote@v1.5.2
! stderr github ! stderr github
stderr proxy.golang.org/rsc.io/quote ! stderr proxy.golang.org/rsc.io/quote
stderr sum.golang.org/tile stderr sum.golang.org/tile
stderr sum.golang.org/lookup/rsc.io/quote stderr sum.golang.org/lookup/rsc.io/quote
cmp go.sum saved.sum
# test fallback to direct # test fallback to direct
env TESTGOPROXY404=1 env TESTGOPROXY404=1
go get -x -d rsc.io/quote go clean -modcache
rm go.sum
go get -x -d rsc.io/quote@v1.5.2
stderr 'proxy.golang.org.*404 testing' stderr 'proxy.golang.org.*404 testing'
stderr github.com/rsc stderr github.com/rsc
cmp go.sum saved.sum
-- go.mod -- -- go.mod --
module m module m
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment