You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Makefile
+86-2Lines changed: 86 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -78,15 +78,43 @@ vet: ## Run go vet against code.
78
78
test: manifests generate fmt vet envtest ## Run tests.
79
79
ENVTEST_K8S_VERSION=$(ENVTEST_K8S_VERSION)\
80
80
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test -v $$(go list ./... | grep -v /e2e) -coverprofile cover.out
81
+
@echo "==> Validating Helm Chart generation..."
82
+
$(MAKE) helm
83
+
@echo "==> Running Helm lint..."
84
+
$(HELM) lint helm/
85
+
@echo "==> Testing Helm template rendering..."
86
+
$(HELM) template test helm/ > /dev/null
87
+
@echo "✅ All tests passed including Helm validation!"
81
88
82
89
# TODO(user): To use a different vendor for e2e tests, modify the setup under 'tests/e2e'.
83
90
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
84
91
# Prometheus and CertManager are installed by default; skip with:
85
92
# - PROMETHEUS_INSTALL_SKIP=true
86
93
# - CERT_MANAGER_INSTALL_SKIP=true
94
+
#
95
+
# DEPLOY_METHOD controls the deployment method for E2E tests:
96
+
# - all (default): Test both deployment methods sequentially
97
+
# - kustomize: Deploy using Kustomize only
98
+
# - helm: Deploy using Helm Chart only
99
+
DEPLOY_METHOD ?= all
100
+
87
101
.PHONY: test-e2e
88
-
test-e2e: generate fmt vet kind ## Run the e2e tests. Expected an isolated environment using Kind.
89
-
ETCD_VERSION="$(E2E_ETCD_VERSION)" PATH="$(LOCALBIN):$(PATH)" go test ./test/e2e/ -v
102
+
test-e2e: generate fmt vet kind helm-tool ## Run the e2e tests. Expected an isolated environment using Kind.
103
+
@if [ "$(DEPLOY_METHOD)"="all" ];then\
104
+
echo"==> Testing all deployment methods...";\
105
+
echo"";\
106
+
echo"==> [1/2] Testing Kustomize deployment";\
107
+
DEPLOY_METHOD=kustomize ETCD_VERSION="$(E2E_ETCD_VERSION)" PATH="$(LOCALBIN):$(PATH)" go test ./test/e2e/ -v ||exit 1;\
108
+
echo"";\
109
+
echo"==> [2/2] Testing Helm deployment";\
110
+
$(MAKE) helm;\
111
+
DEPLOY_METHOD=helm ETCD_VERSION="$(E2E_ETCD_VERSION)" PATH="$(LOCALBIN):$(PATH)" go test ./test/e2e/ -v ||exit 1;\
112
+
echo"";\
113
+
echo"✅ All deployment methods tested successfully!";\
114
+
else\
115
+
echo"==> Testing with DEPLOY_METHOD=$(DEPLOY_METHOD)";\
116
+
ETCD_VERSION="$(E2E_ETCD_VERSION)" PATH="$(LOCALBIN):$(PATH)" go test ./test/e2e/ -v;\
117
+
fi
90
118
91
119
.PHONY: lint
92
120
lint: golangci-lint ## Run golangci-lint linter
@@ -157,6 +185,27 @@ build-installer: manifests generate kustomize ## Generate a consolidated YAML wi
157
185
cd config/manager &&$(KUSTOMIZE) edit set image controller=${IMG}
0 commit comments