Skip to content

Commit 2876cd0

Browse files
[no-relnote] add helper make targets to tests/e2e/Makefile
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
1 parent 4ae9de1 commit 2876cd0

File tree

1 file changed

+53
-3
lines changed

1 file changed

+53
-3
lines changed

tests/e2e/Makefile

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,60 @@ E2E_IMAGE_PULL_POLICY ?= IfNotPresent
2929
HELM_CHART ?= $(CURDIR)/deployments/helm/nvidia-device-plugin
3030
LOG_ARTIFACTS ?= $(CURDIR)/e2e_logs
3131

32-
.PHONY: ginkgo e2e-test
32+
# Test configuration
33+
GINKGO_PARALLEL_PROCS ?= 4
34+
GINKGO_FLAKE_ATTEMPTS ?= 2
35+
GINKGO_COMMON_ARGS := -v --fail-on-pending --randomize-all --trace
36+
GINKGO_REPORT_ARGS := --json-report=$(LOG_ARTIFACTS)/report.json --junit-report=$(LOG_ARTIFACTS)/junit.xml
37+
38+
.PHONY: ginkgo e2e-test e2e-test-parallel e2e-test-serial e2e-test-all clean-artifacts
39+
3340
ginkgo:
3441
mkdir -p $(CURDIR)/bin
3542
GOBIN=$(CURDIR)/bin go install github.com/onsi/ginkgo/v2/ginkgo@latest
3643

37-
test-e2e: ginkgo
38-
$(CURDIR)/bin/ginkgo $(GINKGO_ARGS) -v --json-report ginkgo.json ./tests/e2e/...
44+
# Create artifacts directory
45+
$(LOG_ARTIFACTS):
46+
mkdir -p $(LOG_ARTIFACTS)
47+
48+
# Clean artifacts
49+
clean-artifacts:
50+
rm -rf $(LOG_ARTIFACTS)
51+
52+
# Run all tests (default)
53+
test-e2e: ginkgo $(LOG_ARTIFACTS)
54+
$(CURDIR)/bin/ginkgo $(GINKGO_COMMON_ARGS) $(GINKGO_REPORT_ARGS) $(GINKGO_ARGS) ./tests/e2e/...
55+
56+
# Run only parallel-safe tests
57+
test-e2e-parallel: ginkgo $(LOG_ARTIFACTS)
58+
$(CURDIR)/bin/ginkgo $(GINKGO_COMMON_ARGS) $(GINKGO_REPORT_ARGS) \
59+
--procs=$(GINKGO_PARALLEL_PROCS) \
60+
--label-filter='!serial' \
61+
$(GINKGO_ARGS) ./tests/e2e/...
62+
63+
# Run only serial tests (cluster-mutating)
64+
test-e2e-serial: ginkgo $(LOG_ARTIFACTS)
65+
$(CURDIR)/bin/ginkgo $(GINKGO_COMMON_ARGS) $(GINKGO_REPORT_ARGS) \
66+
--label-filter='serial' \
67+
$(GINKGO_ARGS) ./tests/e2e/...
68+
69+
# Run parallel tests first, then serial tests
70+
test-e2e-all: test-e2e-parallel test-e2e-serial
71+
72+
# Run tests with flake attempts
73+
test-e2e-flaky: ginkgo $(LOG_ARTIFACTS)
74+
$(CURDIR)/bin/ginkgo $(GINKGO_COMMON_ARGS) $(GINKGO_REPORT_ARGS) \
75+
--flake-attempts=$(GINKGO_FLAKE_ATTEMPTS) \
76+
$(GINKGO_ARGS) ./tests/e2e/...
77+
78+
# Run specific test by label
79+
test-e2e-label: ginkgo $(LOG_ARTIFACTS)
80+
$(CURDIR)/bin/ginkgo $(GINKGO_COMMON_ARGS) $(GINKGO_REPORT_ARGS) \
81+
--label-filter='$(LABEL)' \
82+
$(GINKGO_ARGS) ./tests/e2e/...
83+
84+
# Run tests and generate coverage
85+
test-e2e-coverage: ginkgo $(LOG_ARTIFACTS)
86+
$(CURDIR)/bin/ginkgo $(GINKGO_COMMON_ARGS) $(GINKGO_REPORT_ARGS) \
87+
--cover --coverprofile=$(LOG_ARTIFACTS)/coverage.out \
88+
$(GINKGO_ARGS) ./tests/e2e/...

0 commit comments

Comments
 (0)