From 00f59654f35f2beb949e20c2b57f0b7161b38ae9 Mon Sep 17 00:00:00 2001 From: Murphy Chen Date: Thu, 18 Sep 2025 17:38:52 +0800 Subject: [PATCH] improve the readable of test-unit make target --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 023ed0e5f..c4ffbb92b 100644 --- a/Makefile +++ b/Makefile @@ -138,7 +138,9 @@ test: generate fmt vet envtest image-build verify-crds ## Run tests. .PHONY: test-unit test-unit: ## Run unit tests. - CGO_ENABLED=1 KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./pkg/... -race -coverprofile cover.out + CGO_ENABLED=1 KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./pkg/... -race -coverprofile cover.out; \ + go tool cover -func=cover.out; \ + rm cover.out .PHONY: test-integration test-integration: envtest ## Run integration tests.