message/pipeline: skip test if the 'go' executable is not found
Fixes golang/go#32844
Change-Id: I9d5364df4f827db4de3c144a565c1d05d8a181bd
Reviewed-on: https://go-review.googlesource.com/c/text/+/192325
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
diff --git a/message/pipeline/pipeline_test.go b/message/pipeline/pipeline_test.go
index 4550455..1f5e44f 100644
--- a/message/pipeline/pipeline_test.go
+++ b/message/pipeline/pipeline_test.go
@@ -12,6 +12,7 @@
"fmt"
"io/ioutil"
"os"
+ "os/exec"
"path"
"path/filepath"
"runtime"
@@ -30,6 +31,10 @@
if runtime.GOOS == "android" {
t.Skip("cannot load outside packages on android")
}
+ if _, err := exec.LookPath("go"); err != nil {
+ t.Skipf("skipping because 'go' command is unavailable: %v", err)
+ }
+
const path = "./testdata"
dirs, err := ioutil.ReadDir(path)
if err != nil {