You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ge...@apache.org on 2022/08/05 15:17:37 UTC

[solr-operator] branch main updated: Use GOARCH=amd64 when testing on 'Apple Silicon' (#462)

This is an automated email from the ASF dual-hosted git repository.

gerlowskija pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new fb46d93  Use GOARCH=amd64 when testing on 'Apple Silicon' (#462)
fb46d93 is described below

commit fb46d931a6b22c7f17b2b64cc02eb8013a75781f
Author: Jason Gerlowski <ge...@apache.org>
AuthorDate: Fri Aug 5 11:17:33 2022 -0400

    Use GOARCH=amd64 when testing on 'Apple Silicon' (#462)
    
    There is no arm64 artifact for our current version of kubebuilder-tools,
    which causes test setup to fail on M1 machines.  However, the amd64
    artifact offered by kubebuilder seems to work well enough for our
    purposes, so we can use that as a workaround until we're able to upgrade
    kubebuilder-tools down the road.
---
 Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 7f503cb..7d81ab4 100644
--- a/Makefile
+++ b/Makefile
@@ -227,8 +227,10 @@ check-git: ## Check to make sure the repo does not have uncommitted code
 
 ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
 test: manifests generate ## Run the unit tests
-	mkdir -p ${ENVTEST_ASSETS_DIR}
-	test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.8.3/hack/setup-envtest.sh
+	# Kubebuilder-tools doesn't have a darwin+arm (i.e. Apple Silicon) distribution but the amd one works fine for our purposes
+	if [[ "${GOOS}" == "darwin" && "${ARCH}" == "arm64" ]]; then export GOARCH=amd64; fi; \
+	mkdir -p ${ENVTEST_ASSETS_DIR}; \
+	test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.8.3/hack/setup-envtest.sh; \
 	source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); GINKGO_EDITOR_INTEGRATION=true go test ./... -coverprofile cover.out
 
 ##@ Helm