1
0
mirror of https://github.com/golang/go synced 2024-11-23 07:30:05 -07:00

cmd/go: convert TestGoGetNonPkg to the script framework

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ieaddc20aebd0b71189f2ebc8f8e2758f1117bbed
Reviewed-on: https://go-review.googlesource.com/c/go/+/213826
Reviewed-by: Jay Conrod <jayconrod@google.com>
This commit is contained in:
Michael Matloob 2020-01-08 14:45:04 -05:00
parent a737299f38
commit 0119933477
2 changed files with 14 additions and 17 deletions

View File

@ -1204,23 +1204,6 @@ func TestPackageNotStaleWithTrailingSlash(t *testing.T) {
tg.wantNotStale("io", "", "with trailing slash in GOROOT, io listed as stale")
}
func TestGoGetNonPkg(t *testing.T) {
testenv.MustHaveExternalNetwork(t)
testenv.MustHaveExecPath(t, "git")
tg := testgo(t)
defer tg.cleanup()
tg.tempDir("gobin")
tg.setenv("GOPATH", tg.path("."))
tg.setenv("GOBIN", tg.path("gobin"))
tg.runFail("get", "-d", "golang.org/x/tools")
tg.grepStderr("golang.org/x/tools: no Go files", "missing error")
tg.runFail("get", "-d", "-u", "golang.org/x/tools")
tg.grepStderr("golang.org/x/tools: no Go files", "missing error")
tg.runFail("get", "-d", "golang.org/x/tools")
tg.grepStderr("golang.org/x/tools: no Go files", "missing error")
}
func TestGoGetTestOnlyPkg(t *testing.T) {
testenv.MustHaveExternalNetwork(t)
testenv.MustHaveExecPath(t, "git")

View File

@ -0,0 +1,14 @@
[!net] skip
[!exec:git] skip
env GOBIN=$WORK/tmp/gobin
env GO111MODULE=off
! go get -d golang.org/x/tools
stderr 'golang.org/x/tools: no Go files'
! go get -d -u golang.org/x/tools
stderr 'golang.org/x/tools: no Go files'
! go get -d golang.org/x/tools
stderr 'golang.org/x/tools: no Go files'