Skip to content

Update Makefile to support running specific unit and e2e tests (#1230) #1240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -211,15 +211,32 @@ e2e-ipv6:
format:
./hack/format.sh

.PHONY: test
ifeq ($(RUN_IN_CONTAINER),1)
test:
# Variables for test filtering
RUN_IN_CONTAINER ?= 0
UNIT_TEST_PATTERN ?= .
E2E_TEST_PATTERN ?= .

# Run unit tests
.PHONY: test-unit
test-unit:
ifeq ($(RUN_IN_CONTAINER), 1)
@echo "Running unit tests in Docker..."
./hack/run-ut.sh --docker
else
test:
@echo "Running unit tests locally..."
./hack/run-ut.sh --local
endif

# Run E2E tests
.PHONY: test-e2e
test-e2e:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have make e2e, could you expand functionalities under it. Prefer not providing too many entries to run e2e

@echo "Running E2E tests..."
./test/e2e/run_test.sh --only-run-tests

# Run all tests (unit + E2E)
.PHONY: test
test: test-unit test-e2e

UPDATE_VERSION ?= ${VERSION}
.PHONY: update-version
update-version:
@@ -288,4 +305,4 @@ helm-push: helm-package
# run other make targets
@for chart in $(CHARTS); do \
$(MAKE) $(addprefix helm-push., $$(basename $${chart})); \
done
done
Loading
Oops, something went wrong.