fix: use CommandContext in deployment test

This commit is contained in:
2026-01-07 09:54:46 +01:00
parent 365c9a8482
commit 75a33994db

View File

@@ -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)