aboutsummaryrefslogtreecommitdiff
path: root/internal/stdlib/stdlib_test.go
diff options
context:
space:
mode:
authorMichael Matloob <matloob@golang.org>2023-07-06 15:07:42 -0400
committerMichael Matloob <matloob@google.com>2023-07-06 20:20:20 +0000
commit127f46c73bd588d8248c3d281b87dca15e5b2e36 (patch)
tree1b72d7f4192e21928705f7d4d7d452fb3d45ba0f /internal/stdlib/stdlib_test.go
parent32beeac06f606f1bab4884bf112d40479e7b93ad (diff)
downloadgo-x-pkgsite-127f46c73bd588d8248c3d281b87dca15e5b2e36.tar.xz
internal/testenv: add and use MustHaveExternalNetwork function
This CL adds a copy of the MustHaveExternalNetwork function from the testenv package in the Go repo for use for filtering out tests that need the network access from running on builders that don't guarantee it. (External network access is only enabled on longtest builders). It also calls the function from two tests that are failing because they make external network calls. For #61209 Change-Id: I68ed1d3f8bb65697b1025bca0ba40aa0ab7423a3 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/508295 Reviewed-by: Robert Findley <rfindley@google.com> Run-TryBot: Michael Matloob <matloob@google.com> TryBot-Bypass: Michael Matloob <matloob@google.com> Reviewed-by: Michael Matloob <matloob@google.com>
Diffstat (limited to 'internal/stdlib/stdlib_test.go')
-rw-r--r--internal/stdlib/stdlib_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/stdlib/stdlib_test.go b/internal/stdlib/stdlib_test.go
index 72975825..8841b0a8 100644
--- a/internal/stdlib/stdlib_test.go
+++ b/internal/stdlib/stdlib_test.go
@@ -12,6 +12,7 @@ import (
"testing"
"golang.org/x/mod/semver"
+ "golang.org/x/pkgsite/internal/testenv"
"golang.org/x/pkgsite/internal/version"
)
@@ -379,6 +380,8 @@ func TestVersionMatchesHash(t *testing.T) {
}
func TestResolveSupportedBranches(t *testing.T) {
+ testenv.MustHaveExternalNetwork(t) // ResolveSupportedBranches accesses the go repo at go.googlesource.com
+
got, err := ResolveSupportedBranches()
if err != nil {
t.Fatal(err)