mirror of
https://github.com/golang/go.git
synced 2026-08-02 20:44:20 +08:00
cmd/go/testdata/script: don't use network in mod_gonoproxy test
Create fake modules in the proxy that we intend to not fetch. For #80243 Change-Id: Iad6a205039fa2cf512073d5f4870ce776a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/795907 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Michael Matloob <matloob@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
0f091acc1a
commit
44db00e9c1
8
src/cmd/go/testdata/mod/vcs-test.golang.org_git_proxyonly.git_v0.0.1.txt
vendored
Normal file
8
src/cmd/go/testdata/mod/vcs-test.golang.org_git_proxyonly.git_v0.0.1.txt
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
This is a module that could exist in a vcstest git repo, but that doesn't.
|
||||
|
||||
-- .mod --
|
||||
module vcs-test.golang.org/git/proxyonly.git
|
||||
-- .info --
|
||||
{"Version":"v0.0.1"}
|
||||
-- proxyonly.go --
|
||||
package proxyonly
|
||||
9
src/cmd/go/testdata/mod/vcs-test.golang.org_git_tagtests.git_v0.1.0.txt
vendored
Normal file
9
src/cmd/go/testdata/mod/vcs-test.golang.org_git_tagtests.git_v0.1.0.txt
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
There's a tagtests git repo, but add a proxy version, so we
|
||||
can test that it's not available in mod_gonoproxy.
|
||||
|
||||
-- .mod --
|
||||
module vcs-test.golang.org/git/tagtests.git
|
||||
-- .info --
|
||||
{"Version":"v0.1.0"}
|
||||
-- tagtests.go --
|
||||
package tagtests
|
||||
19
src/cmd/go/testdata/script/mod_gonoproxy.txt
vendored
19
src/cmd/go/testdata/script/mod_gonoproxy.txt
vendored
@ -35,21 +35,24 @@ env GOPROXY=off
|
||||
! go get golang.org/x/text
|
||||
stderr '^go: golang.org/x/text: module lookup disabled by GOPROXY=off$'
|
||||
|
||||
[short] skip 'the rest of the test uses git'
|
||||
|
||||
# GONOPROXY bypasses proxy
|
||||
[!net:rsc.io] skip
|
||||
[!git] skip
|
||||
env GOPROXY=$proxy
|
||||
env GOSUMDB=$sumdb
|
||||
env GOPRIVATE=none
|
||||
env GONOPROXY='*/fortune'
|
||||
! go get rsc.io/fortune # does not exist in real world, only on test proxy
|
||||
env GONOPROXY='*/git/proxyonly.git'
|
||||
! go get vcs-test.golang.org/git/proxyonly.git # does not exist in vcstest, only on test proxy
|
||||
stderr 'git ls-remote'
|
||||
|
||||
[!net:golang.org] skip
|
||||
env GOSUMDB=
|
||||
env GOSUMDB=off
|
||||
env GONOPROXY=
|
||||
env GOPRIVATE='*/x'
|
||||
go get golang.org/x/text
|
||||
env GOPRIVATE='*/git/tagtests.git'
|
||||
go get vcs-test.golang.org/git/tagtests.git
|
||||
go list -m all
|
||||
! stdout 'text.*v0.0.0-2017' # should not have the version from the proxy
|
||||
stdout '^vcs-test.golang.org/git/tagtests.git v0.2.2$'
|
||||
! stdout 'tagtests.git v0.1.0' # should not have the version from the proxy
|
||||
|
||||
-- go.mod.orig --
|
||||
module m
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user