File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 6767 uses : actions/setup-go@v5
6868 with :
6969 go-version : ${{ env.GOLANG_VERSION }}
70- - run : make test
70+ - run : make coverage
7171 build :
7272 name : Build
7373 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ testbin/*
1414
1515# Output of the go coverage tool, specifically when used with LiteIDE
1616* .out
17+ * .out.no-mocks
1718
1819# Kubernetes Generated files - skip generated files, except for vendored files
1920! vendor /** /zz_generated. *
Original file line number Diff line number Diff line change @@ -112,9 +112,16 @@ vet: ## Run go vet against code.
112112check-vendor : vendor
113113 git diff --quiet HEAD -- go.mod go.sum
114114
115+ COVERAGE_FILE := cover.out
116+
117+ .PHONY : coverage
118+ coverage : test
119+ cat $(COVERAGE_FILE ) | grep -v " _mock.go" > $(COVERAGE_FILE ) .no-mocks
120+ go tool cover -func=$(COVERAGE_FILE ) .no-mocks
121+
115122.PHONY : test
116123test : manifests generate fmt vet envtest # # Run tests.
117- KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use $( ENVTEST_K8S_VERSION) --bin-dir $( LOCALBIN) -p path) " go test $$(go list ./... | grep -v /e2e ) -coverprofile cover.out
124+ KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use $( ENVTEST_K8S_VERSION) --bin-dir $( LOCALBIN) -p path) " go test $$(go list ./... | grep -v test/ | grep -v api/ ) -coverprofile $( COVERAGE_FILE )
118125
119126# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
120127.PHONY : test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.
You can’t perform that action at this time.
0 commit comments