Skip to content

Commit 9fbe333

Browse files
committed
UPSTREAM: <carry>: Use oc client for running e2e tests
Expose docker-registry to e2e test code by creating Openshift route
1 parent 58a6875 commit 9fbe333

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

openshift/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ verify-manifests: manifests
3333

3434
E2E_REGISTRY_NAME=docker-registry
3535
E2E_REGISTRY_NAMESPACE=operator-controller-e2e
36-
export LOCAL_REGISTRY_HOST := $(E2E_REGISTRY_NAME).$(E2E_REGISTRY_NAMESPACE).svc:5000
3736
export CLUSTER_REGISTRY_HOST := $(E2E_REGISTRY_NAME).$(E2E_REGISTRY_NAMESPACE).svc:5000
3837
export REG_PKG_NAME := registry-operator
3938
export E2E_TEST_CATALOG_V1 := e2e/test-catalog:v1
4039
export E2E_TEST_CATALOG_V2 := e2e/test-catalog:v2
41-
export CATALOG_IMG := $(LOCAL_REGISTRY_HOST)/$(E2E_TEST_CATALOG_V1)
40+
export CATALOG_IMG := $(CLUSTER_REGISTRY_HOST)/$(E2E_TEST_CATALOG_V1)
4241

4342
# Order matters here, the ".../registries.conf" entry must be last.
44-
export DOWNSTREAM_E2E_FLAGS := -count=1 -v -skip 'TestClusterExtensionInstallReResolvesWhenNewCatalog|TestClusterExtensionInstallRegistryDynamic|TestClusterExtensionInstallRegistry/package_requires_mirror_registry_configuration_in_/etc/containers/registries.conf'
43+
export DOWNSTREAM_E2E_FLAGS := -count=1 -v
4544
.PHONY: test-e2e
4645
test-e2e: ## Run the e2e tests.
4746
$(DIR)/operator-controller/build-test-registry.sh $(E2E_REGISTRY_NAMESPACE) $(E2E_REGISTRY_NAME) $(E2E_REGISTRY_IMAGE)
4847
cd $(DIR)/../; \
49-
go test $(DOWNSTREAM_E2E_FLAGS) ./test/e2e/...;
48+
LOCAL_REGISTRY_HOST=$$(oc get route $(E2E_REGISTRY_NAME) -n $(E2E_REGISTRY_NAMESPACE) -o jsonpath='{.spec.host}') \
49+
go test $(DOWNSTREAM_E2E_FLAGS) ./test/e2e/features_test.go --godog.tags="~@mirrored-registry && ~@catalog-updates" --k8s.cli=oc
5050

5151
export DOWNSTREAM_EXPERIMENTAL_E2E_FLAGS := -count=1 -v
5252
.PHONY: test-experimental-e2e

openshift/operator-controller/build-test-registry.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ spec:
8181
- name: http
8282
port: 5000
8383
targetPort: 5000
84-
type: NodePort
84+
type: ClusterIP
8585
EOF
8686

8787
oc wait --for=condition=Available -n "${namespace}" "deploy/${name}" --timeout=60s
@@ -118,3 +118,7 @@ spec:
118118
EOF
119119

120120
oc wait --for=condition=Complete -n "${namespace}" "job/${name}-push" --timeout=60s
121+
122+
oc create route passthrough ${name} --service ${name} -n ${namespace}
123+
124+
oc get route ${name} -n ${namespace} -o yaml

0 commit comments

Comments
 (0)