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: components/compass-runtime-agent/Makefile
+22
Original file line number
Diff line number
Diff line change
@@ -17,3 +17,25 @@ release:
17
17
.PHONY: path-to-referenced-charts
18
18
path-to-referenced-charts:
19
19
@echo "resources/compass-runtime-agent"
20
+
21
+
.PHONY: test
22
+
test: envtest ## Run tests.
23
+
if [ -d"$(ARTIFACTS)" ];then \
24
+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -v -coverprofile $(ARTIFACTS)/filtered.cov;\
25
+
else\
26
+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -v;\
27
+
fi
28
+
29
+
30
+
ENVTEST_K8S_VERSION = 1.26.0
31
+
32
+
LOCALBIN ?= $(shell pwd)/bin
33
+
$(LOCALBIN):
34
+
mkdir -p $(LOCALBIN)
35
+
36
+
ENVTEST ?= $(LOCALBIN)/setup-envtest
37
+
38
+
.PHONY: envtest
39
+
envtest: $(ENVTEST)## Download envtest-setup locally if necessary.
40
+
$(ENVTEST): $(LOCALBIN)
41
+
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
0 commit comments