File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ IMG ?= controller:latest
2020# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
2121ENVTEST_K8S_VERSION = 1.23
2222
23+ GO ?= go
24+
2325# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
2426ifeq (,$(shell go env GOBIN) )
2527GOBIN =$(shell go env GOPATH) /bin
@@ -74,6 +76,15 @@ vet: ## Run go vet against code.
7476.PHONY : test
7577test : manifests generate fmt vet envtest # # Run tests.
7678 KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use $( ENVTEST_K8S_VERSION) -p path) " go test ./... -coverprofile cover.out
79+ grep -v -e " _moq.go" cover.out > coverage.out
80+
81+ test/output/coverage/report :
82+ @if [ -f coverage.out ]; then $(GO ) tool cover -func=coverage.out; else echo " coverage.out file not found" ; fi ;
83+ .PHONY : test/output/coverage/report
84+
85+ test/html/coverage/report :
86+ @if [ -f coverage.out ]; then $(GO ) tool cover -html=coverage.out; else echo " coverage.out file not found" ; fi ;
87+ .PHONY : test/html/coverage/report
7788
7889# #@ Build
7990
You can’t perform that action at this time.
0 commit comments