fix: use CommandContext in deployment test
This commit is contained in:
@@ -1,11 +1,13 @@
|
|||||||
package e2e
|
package e2e
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestE2E_DockerDeployment(t *testing.T) {
|
func TestE2E_DockerDeployment(t *testing.T) {
|
||||||
@@ -165,7 +167,10 @@ func TestE2E_BinaryExists(t *testing.T) {
|
|||||||
workspaceRoot = parent
|
workspaceRoot = parent
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := exec.Command("go", "build", "-o", "/tmp/goyco-test", "./cmd/goyco")
|
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
cmd := exec.CommandContext(ctx, "go", "build", "-o", "/tmp/goyco-test", "./cmd/goyco")
|
||||||
cmd.Dir = workspaceRoot
|
cmd.Dir = workspaceRoot
|
||||||
if err := cmd.Run(); err != nil {
|
if err := cmd.Run(); err != nil {
|
||||||
t.Skipf("Failed to build binary: %v", err)
|
t.Skipf("Failed to build binary: %v", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user