diff options
| author | Ian Lance Taylor <iant@golang.org> | 2016-12-01 14:27:06 -0800 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2016-12-01 23:42:04 +0000 |
| commit | fd483b6f62d3d7af915d71df6e654e5edcbc188c (patch) | |
| tree | 3314e3f6c609e5d290f8f5cefdcbe9ac1f354948 /src | |
| parent | e3a1d0cb7c9e68d60b207a683e5f3ba23e62cb91 (diff) | |
| download | go-fd483b6f62d3d7af915d71df6e654e5edcbc188c.tar.xz | |
cmd/go: check MustHaveExternalNetwork before `go get` tests
Also change a couple of `go get` tests to use MustHaveExternalNetwork
rather than checking testing.Short.
Change-Id: I98ccc05b8b0354f1b7486e28dac5f8341c342a07
Reviewed-on: https://go-review.googlesource.com/33802
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/go/go_test.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 5731066fd6..6c597ed744 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -1700,6 +1700,8 @@ func TestMissingGOPATHEnvShowsDefault(t *testing.T) { // Test go get missing GOPATH causes go get to warn if directory doesn't exist. func TestMissingGOPATHGetWarnsIfNotExists(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + if _, err := exec.LookPath("git"); err != nil { t.Skip("skipping because git binary not found") } @@ -1727,6 +1729,8 @@ func TestMissingGOPATHGetWarnsIfNotExists(t *testing.T) { // Test go get missing GOPATH causes no warning if directory exists. func TestMissingGOPATHGetDoesntWarnIfExists(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + if _, err := exec.LookPath("git"); err != nil { t.Skip("skipping because git binary not found") } @@ -1757,6 +1761,8 @@ func TestMissingGOPATHGetDoesntWarnIfExists(t *testing.T) { // Test go get missing GOPATH fails if pointed file is not a directory. func TestMissingGOPATHGetFailsIfItsNotDirectory(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + tg := testgo(t) defer tg.cleanup() @@ -2067,9 +2073,7 @@ func TestCaseCollisions(t *testing.T) { // Issue 8181. func TestGoGetDashTIssue8181(t *testing.T) { - if testing.Short() { - t.Skip("skipping test that uses network in short mode") - } + testenv.MustHaveExternalNetwork(t) tg := testgo(t) defer tg.cleanup() @@ -2083,9 +2087,7 @@ func TestGoGetDashTIssue8181(t *testing.T) { func TestIssue11307(t *testing.T) { // go get -u was not working except in checkout directory - if testing.Short() { - t.Skip("skipping test that uses network in short mode") - } + testenv.MustHaveExternalNetwork(t) tg := testgo(t) defer tg.cleanup() |
