mirror of
https://github.com/adnanh/webhook.git
synced 2025-05-29 16:52:28 +00:00
tests: use GOROOT to find go command
This should ensure that, even if a developer or CI server has multiple versions of go installed, the version used to build the tools under test will be the same version that is running the test harness.
This commit is contained in:
parent
c72da0b125
commit
be8389ed4d
1 changed files with 4 additions and 2 deletions
|
@ -214,7 +214,8 @@ func buildHookecho(t *testing.T) (binPath string, cleanupFn func()) {
|
|||
binPath += ".exe"
|
||||
}
|
||||
|
||||
cmd := exec.Command("go", "build", "-o", binPath, "test/hookecho.go")
|
||||
gobin := filepath.Join(runtime.GOROOT(), "bin", "go")
|
||||
cmd := exec.Command(gobin, "build", "-o", binPath, "test/hookecho.go")
|
||||
if err := cmd.Run(); err != nil {
|
||||
t.Fatalf("Building hookecho: %v", err)
|
||||
}
|
||||
|
@ -272,7 +273,8 @@ func buildWebhook(t *testing.T) (binPath string, cleanupFn func()) {
|
|||
binPath += ".exe"
|
||||
}
|
||||
|
||||
cmd := exec.Command("go", "build", "-o", binPath)
|
||||
gobin := filepath.Join(runtime.GOROOT(), "bin", "go")
|
||||
cmd := exec.Command(gobin, "build", "-o", binPath)
|
||||
if err := cmd.Run(); err != nil {
|
||||
t.Fatalf("Building webhook: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue