Skip to content

Commit a4e2079

Browse files
committed
tests: Add TEST_PATHS target for make test
TEST_PATHS defaults to the previous hardcoded value of './...', but can now be overridden. e.g. To run just the controller tests: make test TEST_PATHS=./controllers/...
1 parent 120bc68 commit a4e2079

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,13 @@ ifdef KUBEBUILDER_ASSETS_DIR
134134
endif
135135

136136
.PHONY: test
137+
TEST_PATHS ?= ./...
137138
test: $(SETUP_ENVTEST) ## Run tests
138139
set -xeuf -o pipefail; \
139140
if [ -z "$(KUBEBUILDER_ASSETS)" ]; then \
140141
KUBEBUILDER_ASSETS=`$(SETUP_ENVTEST) use --use-env -p path $(setup_envtest_extra_args) $(KUBEBUILDER_ENVTEST_KUBERNETES_VERSION)`; \
141142
fi; \
142-
KUBEBUILDER_ASSETS="$$KUBEBUILDER_ASSETS" go test -v ./... $(TEST_ARGS)
143+
KUBEBUILDER_ASSETS="$$KUBEBUILDER_ASSETS" go test -v $(TEST_PATHS) $(TEST_ARGS)
143144

144145
E2E_TEMPLATES_DIR=test/e2e/data/infrastructure-openstack
145146
E2E_KUSTOMIZE_DIR=test/e2e/data/kustomize

0 commit comments

Comments
 (0)