diff --git a/Makefile b/Makefile index 79759294cd..af615c5497 100644 --- a/Makefile +++ b/Makefile @@ -444,17 +444,23 @@ test: test-tools-image # Run all unit tests (local version) .PHONY: test-local test-local: test-gitops-engine +# run if TEST_MODULE is empty or does not point to gitops-engine tests +ifneq ($(if $(TEST_MODULE),,ALL)$(filter-out github.com/argoproj/gitops-engine% ./gitops-engine%,$(TEST_MODULE)),) if test "$(TEST_MODULE)" = ""; then \ DIST_DIR=${DIST_DIR} RERUN_FAILS=0 PACKAGES=`go list ./... | grep -v 'test/e2e'` ./hack/test.sh -args -test.gocoverdir="$(PWD)/test-results"; \ else \ DIST_DIR=${DIST_DIR} RERUN_FAILS=0 PACKAGES="$(TEST_MODULE)" ./hack/test.sh -args -test.gocoverdir="$(PWD)/test-results" "$(TEST_MODULE)"; \ fi +endif # Run gitops-engine unit tests .PHONY: test-gitops-engine test-gitops-engine: +# run if TEST_MODULE is empty or points to gitops-engine tests +ifneq ($(if $(TEST_MODULE),,ALL)$(filter github.com/argoproj/gitops-engine% ./gitops-engine%,$(TEST_MODULE)),) mkdir -p $(PWD)/test-results cd gitops-engine && go test -race -cover ./... -args -test.gocoverdir="$(PWD)/test-results" +endif .PHONY: test-race test-race: test-tools-image