From a0bbdd60d911497f44b795042acaf959d146beb4 Mon Sep 17 00:00:00 2001 From: Michael Matloob Date: Wed, 3 Jan 2024 10:57:34 -0500 Subject: [PATCH] internal/tests/deps: skip test if we can't run go command For golang/go#64942 Change-Id: Idffad578d4bb766dd5c9d8d1a500b8f68598b664 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/553695 kokoro-CI: kokoro Reviewed-by: Jonathan Amsterdam LUCI-TryBot-Result: Go LUCI TryBot-Result: Gopher Robot Run-TryBot: Bryan Mills Reviewed-by: Bryan Mills --- internal/tests/deps/cmd_pkgsite_deps_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/tests/deps/cmd_pkgsite_deps_test.go b/internal/tests/deps/cmd_pkgsite_deps_test.go index d8424e63a..b6a73d8a0 100644 --- a/internal/tests/deps/cmd_pkgsite_deps_test.go +++ b/internal/tests/deps/cmd_pkgsite_deps_test.go @@ -9,6 +9,8 @@ import ( "os/exec" "strings" "testing" + + "golang.org/x/pkgsite/internal/testenv" ) // non-test packages are allowed to depend on licensecheck and safehtml, x/ repos, and markdown. @@ -30,6 +32,8 @@ var additionalAllowedTestModDeps = map[string]bool{ } func TestCmdPkgsiteDeps(t *testing.T) { + testenv.MustHaveExecPath(t, "go") + // First, list all dependencies of pkgsite. out, err := exec.Command("go", "list", "-e", "-deps", "golang.org/x/pkgsite/cmd/pkgsite").Output() if err != nil {