diff --git a/managed/Makefile b/managed/Makefile index 9412255408..5c3722002d 100644 --- a/managed/Makefile +++ b/managed/Makefile @@ -36,6 +36,10 @@ release: ## Build pmm-managed release binaries env CGO_ENABLED=0 go build -v $(PMM_LD_FLAGS) -o $(PMM_RELEASE_PATH)/ ./cmd/... $(PMM_RELEASE_PATH)/pmm-managed --version +release-starlark: + env CGO_ENABLED=0 go build -v $(PMM_LD_FLAGS) -o $(PMM_RELEASE_PATH)/ ./cmd/pmm-managed-starlark/... + $(PMM_RELEASE_PATH)/pmm-managed-starlark --version + ARCH=$(shell uname -m) release-dev: ## Build pmm-managed binaries for development if [ $(ARCH) = "aarch64" ]; then \ diff --git a/managed/cmd/pmm-managed-starlark/main_test.go b/managed/cmd/pmm-managed-starlark/main_test.go index f52f76ce86..1eaa23d17b 100644 --- a/managed/cmd/pmm-managed-starlark/main_test.go +++ b/managed/cmd/pmm-managed-starlark/main_test.go @@ -17,10 +17,12 @@ package main import ( "bytes" + "context" "encoding/json" "os" "os/exec" "testing" + "time" "github.com/percona-platform/saas/pkg/check" "github.com/stretchr/testify/assert" @@ -103,8 +105,13 @@ func TestStarlarkSandbox(t *testing.T) { //nolint:tparallel }, } + ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second) + t.Cleanup(cancel) // since we run the binary as a child process to test it we need to build it first. - err := exec.Command("make", "-C", "../..", "release").Run() + command := exec.CommandContext(ctx, "make", "-C", "../..", "release-starlark") + command.Stdout = os.Stdout + command.Stderr = os.Stderr + err := command.Run() require.NoError(t, err) for _, tc := range testCases {