You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Makefile
+18-2Lines changed: 18 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,8 @@ GOBIN=$(shell go env GOBIN)
47
47
endif
48
48
49
49
BUILD_DATETIME := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
50
+
GOCACHE ?= $(shell pwd)/.cache/go-build
51
+
exportGOCACHE
50
52
51
53
## Location to install dependencies to
52
54
LOCALBIN ?= $(shell pwd)/bin
@@ -65,7 +67,21 @@ all: manager
65
67
# Run tests
66
68
ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
67
69
test: generate fmt vet manifests envtest
68
-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn go test ./... -coverprofile cover.out
70
+
@assets="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)";\
71
+
echo"mode: set"> cover.out;\
72
+
forpkgin$$(go list ./...);do \
73
+
gocache=$$(mktemp -d);\
74
+
has_tests=$$(go list -f '{{if or .TestGoFiles .XTestGoFiles}}yes{{end}}' "$$pkg");\
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn go test ./controllers/ -v -ginkgo.v
@@ -302,4 +318,4 @@ redhat-certificated-image-push: ## Push the bundle image.
302
318
.PHONY: generate-metricsdocs
303
319
generate-metricsdocs:
304
320
mkdir -p $(shell pwd)/docs/monitoring
305
-
go run -ldflags="${LDFLAGS}" ./pkg/monitoring/metricsdocs > docs/monitoring/metrics.md
321
+
go run -ldflags="${LDFLAGS}" ./pkg/monitoring/metricsdocs > docs/monitoring/metrics.md
0 commit comments