@@ -211,15 +211,49 @@ e2e-ipv6:
211
211
format :
212
212
./hack/format.sh
213
213
214
+ # New variables for test filtering
215
+ RUN_IN_CONTAINER ?= 0
216
+ UNIT_TEST_PATTERN ?= .
217
+ E2E_TEST_PATTERN ?= .
218
+
219
+ # Run unit tests
220
+ .PHONY : test-unit
221
+ test-unit :
222
+ ifeq ($(RUN_IN_CONTAINER ) , 1)
223
+ @echo "Running unit tests in Docker..."
224
+ ./hack/run-ut.sh --docker -run $(UNIT_TEST_PATTERN)
225
+ else
226
+ @echo "Running unit tests locally..."
227
+ ./hack/run-ut.sh --local -run $(UNIT_TEST_PATTERN)
228
+ endif
229
+
230
+ # Run E2E tests
231
+ .PHONY : test-e2e
232
+ test-e2e :
233
+ @echo " Running E2E tests..."
234
+ ./test/e2e/run_test.sh --only-run-tests -run $(E2E_TEST_PATTERN )
235
+
236
+ # Run all tests (unit + E2E)
214
237
.PHONY : test
215
- ifeq ($(RUN_IN_CONTAINER ) ,1)
216
- test :
217
- ./hack/run-ut.sh --docker
238
+ test : test-unit test-e2e
239
+
240
+ # Run specific unit tests
241
+ .PHONY : test-unit-specific
242
+ test-unit-specific :
243
+ ifeq ($(RUN_IN_CONTAINER ) , 1)
244
+ @echo "Running specific unit tests in Docker..."
245
+ ./hack/run-ut.sh --docker -run $(UNIT_TEST_PATTERN)
218
246
else
219
- test :
220
- ./hack/run-ut.sh --local
247
+ @echo "Running specific unit tests locally..."
248
+ ./hack/run-ut.sh --local -run $(UNIT_TEST_PATTERN)
221
249
endif
222
250
251
+ # Run specific E2E tests
252
+ .PHONY : test-e2e-specific
253
+ test-e2e-specific :
254
+ @echo " Running specific E2E tests..."
255
+ ./test/e2e/run_test.sh --only-run-tests -run $(E2E_TEST_PATTERN )
256
+
223
257
UPDATE_VERSION ?= ${VERSION}
224
258
.PHONY : update-version
225
259
update-version :
@@ -288,4 +322,4 @@ helm-push: helm-package
288
322
# run other make targets
289
323
@for chart in $(CHARTS ) ; do \
290
324
$(MAKE ) $(addprefix helm-push., $$(basename $${chart}) ) ; \
291
- done
325
+ done
0 commit comments