Skip to content

Commit 8f5b7eb

Browse files
committed
Drop UNIT_TEST_DIRS for TEST_PKGS + TEST_FILTER
Signed-off-by: Brett Tofel <[email protected]>
1 parent 8b07b3f commit 8f5b7eb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Makefile

+5-2
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,10 @@ test-ext-dev-e2e: $(OPERATOR_SDK) $(KUSTOMIZE) $(KIND) #HELP Run extension creat
195195
go test -count=1 -v ./test/extension-developer-e2e/...
196196

197197
ENVTEST_VERSION := $(shell go list -m k8s.io/client-go | cut -d" " -f2 | sed 's/^v0\.\([[:digit:]]\{1,\}\)\.[[:digit:]]\{1,\}$$/1.\1.x/')
198-
UNIT_TEST_DIRS := $(shell go list ./... | grep -v /test/ | grep -v /catalogd/test/)
198+
# Define TEST_PKGS to be either user-specified or a default set of packages:
199+
ifeq ($(origin TEST_PKGS), undefined)
200+
TEST_PKGS := $(shell go list ./... | grep -v /test/ | grep -v /catalogd/test/)
201+
endif
199202
COVERAGE_UNIT_DIR := $(ROOT_DIR)/coverage/unit
200203

201204
.PHONY: envtest-k8s-bins #HELP Uses setup-envtest to download and install the binaries required to run ENVTEST-test based locally at the project/bin directory.
@@ -212,7 +215,7 @@ test-unit: $(SETUP_ENVTEST) envtest-k8s-bins #HELP Run the unit tests
212215
-cover -coverprofile ${ROOT_DIR}/coverage/unit.out \
213216
-count=1 -race -short \
214217
-run "$(if $(TEST_FILTER),$(TEST_FILTER),.)" \
215-
$(if $(TEST_PKG),$(TEST_PKG),$(UNIT_TEST_DIRS)) \
218+
$(TEST_PKGS) \
216219
-test.gocoverdir=$(COVERAGE_UNIT_DIR)
217220

218221
.PHONY: image-registry

0 commit comments

Comments
 (0)