Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kubebuilder-tools workaround for darwin/arm64 arch #49

Merged
merged 1 commit into from
Sep 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ else
IMAGE_TAG ?= v$(VERSION)
endif

# kubebuilder-tools still doesn't support darwin/arm64. This is a workaround (https://github.com/kubernetes-sigs/controller-runtime/issues/1657)
ARCH_PARAM =
ifeq ($(shell uname -sm),Darwin arm64)
ARCH_PARAM = --arch=amd64
endif

# BUNDLE_IMG defines the image:tag used for the bundle.
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:$(IMAGE_TAG)
Expand Down Expand Up @@ -153,7 +159,7 @@ clean-cov: ## Remove coverage report

.PHONY: test
test: clean-cov manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out -v -timeout 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am ok with removing -timeout 0, but why -v?

Copy link
Member Author

@didierofrivia didierofrivia Sep 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the verbosity only to match authorino-operator and limitador-operator . I could add it if needed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes please.. verbosity for unittests is a good thing, isn't it?

without -v

KUBEBUILDER_ASSETS="/home/eguzki/.local/share/kubebuilder-envtest/k8s/1.22.1-linux-amd64" go test ./... -coverprofile cover.out 
?   	github.com/kuadrant/kuadrant-operator	[no test files]
?   	github.com/kuadrant/kuadrant-operator/api/v1beta1	[no test files]
ok  	github.com/kuadrant/kuadrant-operator/controllers	8.562s	coverage: 0.0% of statements
?   	github.com/kuadrant/kuadrant-operator/kuadrantcontrollermanifests	[no test files]
?   	github.com/kuadrant/kuadrant-operator/pkg/common	[no test files]
ok  	github.com/kuadrant/kuadrant-operator/pkg/log	0.014s	coverage: 37.5% of statements
?   	github.com/kuadrant/kuadrant-operator/pkg/reconcilers	[no test files]

with -v

KUBEBUILDER_ASSETS="/home/eguzki/.local/share/kubebuilder-envtest/k8s/1.22.1-linux-amd64" go test ./... -coverprofile cover.out -v
?   	github.com/kuadrant/kuadrant-operator	[no test files]
?   	github.com/kuadrant/kuadrant-operator/api/v1beta1	[no test files]
=== RUN   TestAPIs
Running Suite: Controller Suite
===============================
Random Seed: 1664545715
Will run 0 of 0 specs



Ran 0 of 0 Specs in 8.654 seconds
SUCCESS! -- 0 Passed | 0 Failed | 0 Pending | 0 Skipped
You're using deprecated Ginkgo functionality:
=============================================
Ginkgo 2.0 is under active development and will introduce (a small number of) breaking changes.
To learn more, view the migration guide at https://github.com/onsi/ginkgo/blob/v2/docs/MIGRATING_TO_V2.md
To comment, chime in at https://github.com/onsi/ginkgo/issues/711

  You are using a custom reporter.  Support for custom reporters will likely be removed in V2.  Most users were using them to generate junit or teamcity reports and this functionality will be merged into the core reporter.  In addition, Ginkgo 2.0 will support emitting a JSON-formatted report that users can then manipulate to generate custom reports.

  If this change will be impactful to you please leave a comment on https://github.com/onsi/ginkgo/issues/711
  Learn more at: https://github.com/onsi/ginkgo/blob/v2/docs/MIGRATING_TO_V2.md#removed-custom-reporters

To silence deprecations that can be silenced set the following environment variable:
  ACK_GINKGO_DEPRECATIONS=1.16.4

--- PASS: TestAPIs (8.65s)
PASS
coverage: 0.0% of statements
ok  	github.com/kuadrant/kuadrant-operator/controllers	8.679s	coverage: 0.0% of statements
?   	github.com/kuadrant/kuadrant-operator/kuadrantcontrollermanifests	[no test files]
?   	github.com/kuadrant/kuadrant-operator/pkg/common	[no test files]
=== RUN   TestToLevel
--- PASS: TestToLevel (0.00s)
=== RUN   TestToMode
--- PASS: TestToMode (0.00s)
PASS
coverage: 37.5% of statements
ok  	github.com/kuadrant/kuadrant-operator/pkg/log	0.017s	coverage: 37.5% of statements
?   	github.com/kuadrant/kuadrant-operator/pkg/reconcilers	[no test files]

BTW, we need to upgrade ginkgo to v2

KUBEBUILDER_ASSETS="$(shell $(ENVTEST) $(ARCH_PARAM) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out -v

##@ Build

Expand Down