From b21ed47dca4a74757b1efc92596eb3c7153c528a Mon Sep 17 00:00:00 2001 From: Oleksii Kurinnyi Date: Wed, 4 Jun 2025 12:52:06 +0300 Subject: [PATCH] test: fix tests to run on Macos Signed-off-by: Oleksii Kurinnyi --- controllers/controller/devworkspacerouting/suite_test.go | 3 ++- controllers/workspace/suite_test.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/controllers/controller/devworkspacerouting/suite_test.go b/controllers/controller/devworkspacerouting/suite_test.go index ca18835d4..71358024e 100644 --- a/controllers/controller/devworkspacerouting/suite_test.go +++ b/controllers/controller/devworkspacerouting/suite_test.go @@ -18,6 +18,7 @@ import ( "fmt" "os" "path/filepath" + "runtime" "testing" dwv1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha1" @@ -86,7 +87,7 @@ var _ = BeforeSuite(func() { filepath.Join(".", "testdata", "route.crd.yaml"), }, ErrorIfCRDPathMissing: true, - BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s", "1.24.2-linux-amd64"), + BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s", "1.24.2-"+runtime.GOOS+"-"+runtime.GOARCH), } cfg, err := testEnv.Start() diff --git a/controllers/workspace/suite_test.go b/controllers/workspace/suite_test.go index d76e59766..7597846e5 100644 --- a/controllers/workspace/suite_test.go +++ b/controllers/workspace/suite_test.go @@ -19,6 +19,7 @@ import ( "net/http" "os" "path/filepath" + "runtime" "testing" dwv1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha1" @@ -87,7 +88,7 @@ var _ = BeforeSuite(func() { testEnv = &envtest.Environment{ CRDDirectoryPaths: []string{filepath.Join("..", "..", "deploy", "templates", "crd", "bases")}, ErrorIfCRDPathMissing: true, - BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s", "1.24.2-linux-amd64"), + BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s", "1.24.2-"+runtime.GOOS+"-"+runtime.GOARCH), } cfg, err := testEnv.Start()