Skip to content

Commit 99a66c2

Browse files
committed
refactor(e2e): simplify e2e-setup and e2e-test-only targets
Refactor e2e-setup and e2e-test-only to reuse the e2e-test target by setting appropriate environment variables instead of duplicating the command invocation logic. This reduces code duplication and makes the Makefile more maintainable. Changes: - e2e-setup now sets E2E_SETUP_ONLY=true and calls e2e-test - e2e-test-only now sets E2E_USE_EXISTING_CLUSTER=true and E2E_SKIP_SETUP=true, then calls e2e-test - Removed 16 lines of duplicated command invocation code Signed-off-by: bitliu <[email protected]>
1 parent 8cec64e commit 99a66c2

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

tools/make/e2e.mk

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -53,33 +53,13 @@ e2e-test-debug: e2e-test
5353
# Setup profile only without running tests
5454
e2e-setup: ## Setup profile only without running tests
5555
e2e-setup: E2E_SETUP_ONLY=true
56-
e2e-setup: E2E_KEEP_CLUSTER=true
57-
e2e-setup: build-e2e
58-
@$(LOG_TARGET)
59-
@echo "Setting up E2E environment with profile: $(E2E_PROFILE)"
60-
@./bin/e2e \
61-
-profile=$(E2E_PROFILE) \
62-
-cluster=$(E2E_CLUSTER_NAME) \
63-
-image-tag=$(E2E_IMAGE_TAG) \
64-
-keep-cluster=true \
65-
-verbose=$(E2E_VERBOSE) \
66-
-setup-only=true
56+
e2e-setup: e2e-test
6757

6858
# Run tests only without setup (assumes environment is already deployed)
6959
e2e-test-only: ## Run tests only without setup (assumes environment is already deployed)
70-
e2e-test-only: E2E_SKIP_SETUP=true
7160
e2e-test-only: E2E_USE_EXISTING_CLUSTER=true
72-
e2e-test-only: build-e2e
73-
@$(LOG_TARGET)
74-
@echo "Running E2E tests (skip setup) with profile: $(E2E_PROFILE)"
75-
@./bin/e2e \
76-
-profile=$(E2E_PROFILE) \
77-
-cluster=$(E2E_CLUSTER_NAME) \
78-
-use-existing-cluster=true \
79-
-verbose=$(E2E_VERBOSE) \
80-
-parallel=$(E2E_PARALLEL) \
81-
-skip-setup=true \
82-
$(if $(E2E_TESTS),-tests=$(E2E_TESTS),)
61+
e2e-test-only: E2E_SKIP_SETUP=true
62+
e2e-test-only: e2e-test
8363

8464
# Run specific E2E test cases
8565
e2e-test-specific: ## Run specific E2E test cases (E2E_TESTS="test1,test2")

0 commit comments

Comments
 (0)