1212REPO = github.com/operator-framework/api
1313BUILD_PATH = $(REPO ) /cmd/operator-verify
1414PKGS = $(shell go list ./... | grep -v /vendor/)
15+ SPECIFIC_UNIT_TEST := $(if $(TEST ) ,-run $(TEST ) ,)
16+ SPECIFIC_SKIP_UNIT_TEST := $(if $(SKIP ) ,-skip $(SKIP ) ,)
1517
1618.PHONY : help
1719help : # # Show this help screen
@@ -76,13 +78,15 @@ manifests: yq controller-gen ## Generate manifests e.g. CRD, RBAC etc
7678 $(Q)go generate ./crds/...
7779
7880# Static tests.
79- .PHONY : test test-unit verify
81+ .PHONY : test test-unit verify unit
8082
8183test : test-unit # # Run the tests
8284
85+ unit : test-unit # # Run the tests
86+
8387TEST_PKGS: =$(shell go list ./...)
8488test-unit : # # Run the unit tests
85- $(Q ) go test -count=1 -short ${TEST_PKGS}
89+ $(Q ) go test -coverprofile=coverage.out - count=1 ${SPECIFIC_UNIT_TEST} ${SPECIFIC_SKIP_UNIT_TEST} ${TEST_PKGS}
8690
8791verify : manifests generate format tidy
8892 git diff --exit-code
@@ -132,4 +136,4 @@ $(KIND): $(LOCALBIN)
132136.PHONY : kind-cluster
133137kind-cluster : kind # # Create a kind cluster
134138 $(KIND ) create cluster --name olmv0 --image $(KIND_CLUSTER_IMAGE )
135- $(KIND ) export kubeconfig --name olmv0
139+ $(KIND ) export kubeconfig --name olmv0
0 commit comments