mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-08 03:31:59 +02:00
be6199f081
* test: allow to locally skip some tests on missing tools Signed-off-by: Carlos A Becker <caarlos0@gmail.com> * fix: ci tests * fix: helper
20 lines
328 B
Go
20 lines
328 B
Go
package testlib
|
|
|
|
import (
|
|
"os"
|
|
"os/exec"
|
|
"testing"
|
|
)
|
|
|
|
// CheckPath skips the test if the binary is not in the PATH.
|
|
func CheckPath(tb testing.TB, cmd string) {
|
|
tb.Helper()
|
|
if os.Getenv("CI") == "true" {
|
|
// never skip on CI
|
|
return
|
|
}
|
|
if _, err := exec.LookPath(cmd); err != nil {
|
|
tb.Skipf("%s not in PATH", cmd)
|
|
}
|
|
}
|