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