@@ -165,12 +165,16 @@ test-unit: $(SETUP_ENVTEST) #HELP Run the unit tests
165
165
$(UNIT_TEST_DIRS) \
166
166
-test.gocoverdir=$(ROOT_DIR)/coverage/unit
167
167
168
- image-registry: ## Setup in-cluster image registry
169
- ./hack/test/image-registry.sh $(E2E_REGISTRY_NAMESPACE) $(E2E_REGISTRY_NAME)
170
-
171
- build-push-e2e-catalog: ## Build the testdata catalog used for e2e tests and push it to the image registry
172
- ./hack/test/build-push-e2e-catalog.sh $(E2E_REGISTRY_NAMESPACE) $(LOCAL_REGISTRY_HOST)/$(E2E_TEST_CATALOG_V1)
173
- ./hack/test/build-push-e2e-catalog.sh $(E2E_REGISTRY_NAMESPACE) $(LOCAL_REGISTRY_HOST)/$(E2E_TEST_CATALOG_V2)
168
+ .PHONY: image-registry
169
+ E2E_REGISTRY_IMAGE=localhost/e2e-test-registry:devel
170
+ image-registry: export GOOS=linux
171
+ image-registry: export GOARCH=amd64
172
+ image-registry: ## Build the testdata catalog used for e2e tests and push it to the image registry
173
+ go build $(GO_BUILD_FLAGS) -tags '$(GO_BUILD_TAGS)' -ldflags '$(GO_BUILD_LDFLAGS)' -gcflags '$(GO_BUILD_GCFLAGS)' -asmflags '$(GO_BUILD_ASMFLAGS)' -o ./testdata/registry/bin/registry ./testdata/registry/registry.go
174
+ go build $(GO_BUILD_FLAGS) -tags '$(GO_BUILD_TAGS)' -ldflags '$(GO_BUILD_LDFLAGS)' -gcflags '$(GO_BUILD_GCFLAGS)' -asmflags '$(GO_BUILD_ASMFLAGS)' -o ./testdata/push/bin/push ./testdata/push/push.go
175
+ $(CONTAINER_RUNTIME) build -f ./testdata/Dockerfile -t $(E2E_REGISTRY_IMAGE) ./testdata
176
+ $(CONTAINER_RUNTIME) save $(E2E_REGISTRY_IMAGE) | $(KIND) load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME)
177
+ ./testdata/build-test-registry.sh $(E2E_REGISTRY_NAMESPACE) $(E2E_REGISTRY_NAME) $(E2E_REGISTRY_IMAGE)
174
178
175
179
# When running the e2e suite, you can set the ARTIFACT_PATH variable to the absolute path
176
180
# of the directory for the operator-controller e2e tests to store the artifacts, which
@@ -181,7 +185,7 @@ build-push-e2e-catalog: ## Build the testdata catalog used for e2e tests and pus
181
185
test-e2e: KIND_CLUSTER_NAME := operator-controller-e2e
182
186
test-e2e: KUSTOMIZE_BUILD_DIR := config/overlays/e2e
183
187
test-e2e: GO_BUILD_FLAGS := -cover
184
- test-e2e: run image-registry build-push-e2e-catalog registry-load-bundles e2e e2e-coverage kind-clean #HELP Run e2e test suite on local kind cluster
188
+ test-e2e: run image-registry e2e e2e-coverage kind-clean #HELP Run e2e test suite on local kind cluster
185
189
186
190
.PHONY: extension-developer-e2e
187
191
extension-developer-e2e: KUSTOMIZE_BUILD_DIR := config/overlays/cert-manager
@@ -205,7 +209,7 @@ post-upgrade-checks:
205
209
test-upgrade-e2e: KIND_CLUSTER_NAME := operator-controller-upgrade-e2e
206
210
test-upgrade-e2e: export TEST_CLUSTER_CATALOG_NAME := test-catalog
207
211
test-upgrade-e2e: export TEST_CLUSTER_EXTENSION_NAME := test-package
208
- test-upgrade-e2e: kind-cluster run-latest-release image-registry build-push-e2e-catalog registry-load-bundles pre-upgrade-setup docker-build kind-load kind-deploy post-upgrade-checks kind-clean #HELP Run upgrade e2e tests on a local kind cluster
212
+ test-upgrade-e2e: kind-cluster run-latest-release image-registry pre-upgrade-setup docker-build kind-load kind-deploy post-upgrade-checks kind-clean #HELP Run upgrade e2e tests on a local kind cluster
209
213
210
214
.PHONY: e2e-coverage
211
215
e2e-coverage:
@@ -231,12 +235,6 @@ kind-cluster: $(KIND) #EXHELP Standup a kind cluster.
231
235
kind-clean: $(KIND) #EXHELP Delete the kind cluster.
232
236
$(KIND) delete cluster --name $(KIND_CLUSTER_NAME)
233
237
234
- registry-load-bundles: ## Load selected e2e testdata container images created in kind-load-bundles into registry
235
- testdata/bundles/registry-v1/build-push-e2e-bundle.sh ${E2E_REGISTRY_NAMESPACE} $(LOCAL_REGISTRY_HOST)/bundles/registry-v1/prometheus-operator:v1.0.0 prometheus-operator.v1.0.0 prometheus-operator.v1.0.0
236
- testdata/bundles/registry-v1/build-push-e2e-bundle.sh ${E2E_REGISTRY_NAMESPACE} $(LOCAL_REGISTRY_HOST)/bundles/registry-v1/prometheus-operator:v1.0.1 prometheus-operator.v1.0.1 prometheus-operator.v1.0.0
237
- testdata/bundles/registry-v1/build-push-e2e-bundle.sh ${E2E_REGISTRY_NAMESPACE} $(LOCAL_REGISTRY_HOST)/bundles/registry-v1/prometheus-operator:v1.2.0 prometheus-operator.v1.2.0 prometheus-operator.v1.0.0
238
- testdata/bundles/registry-v1/build-push-e2e-bundle.sh ${E2E_REGISTRY_NAMESPACE} $(LOCAL_REGISTRY_HOST)/bundles/registry-v1/prometheus-operator:v2.0.0 prometheus-operator.v2.0.0 prometheus-operator.v1.0.0
239
-
240
238
#SECTION Build
241
239
242
240
ifeq ($(origin VERSION), undefined)
0 commit comments