Skip to content

Commit

Permalink
internal/tests/deps: skip test if we can't run go command
Browse files Browse the repository at this point in the history
For golang/go#64942

Change-Id: Idffad578d4bb766dd5c9d8d1a500b8f68598b664
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/553695
kokoro-CI: kokoro <[email protected]>
Reviewed-by: Jonathan Amsterdam <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Run-TryBot: Bryan Mills <[email protected]>
Reviewed-by: Bryan Mills <[email protected]>
  • Loading branch information
matloob committed Jan 3, 2024
1 parent eb2fcc3 commit a0bbdd6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/tests/deps/cmd_pkgsite_deps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 {
Expand Down

0 comments on commit a0bbdd6

Please sign in to comment.