Skip to content

Commit 7146a7a

Browse files
[Monorepo]: Cleanup: Merge catalogd-e2e tests into operator-controller e2e (#1757)
- Removed `gingko` and `omega` from `unpack_test`. - Ensured that `unpack_test` previously under `catalogd-e2e` is now executed alongside other `operator-controller` e2e tests.
1 parent 237ec1c commit 7146a7a

File tree

6 files changed

+34
-179
lines changed

6 files changed

+34
-179
lines changed

Diff for: .github/workflows/catalogd-e2e.yaml

-9
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ on:
99
- main
1010

1111
jobs:
12-
e2e:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: actions/checkout@v4
16-
- uses: actions/setup-go@v5
17-
with:
18-
go-version-file: "go.mod"
19-
- name: Run E2e
20-
run: make test-catalogd-e2e
2112
upgrade-e2e:
2213
runs-on: ubuntu-latest
2314
steps:

Diff for: Makefile

+1-13
Original file line numberDiff line numberDiff line change
@@ -223,21 +223,9 @@ image-registry: ## Build the testdata catalog used for e2e tests and push it to
223223
test-e2e: KIND_CLUSTER_NAME := operator-controller-e2e
224224
test-e2e: KUSTOMIZE_BUILD_DIR := config/overlays/e2e
225225
test-e2e: GO_BUILD_FLAGS := -cover
226+
test-e2e: CATALOGD_KUSTOMIZE_BUILD_DIR := catalogd/config/overlays/e2e
226227
test-e2e: run image-registry e2e e2e-coverage kind-clean #HELP Run e2e test suite on local kind cluster
227228

228-
# Catalogd e2e tests
229-
FOCUS := $(if $(TEST),-v -focus "$(TEST)")
230-
ifeq ($(origin E2E_FLAGS), undefined)
231-
E2E_FLAGS :=
232-
endif
233-
test-catalogd-e2e: ## Run the e2e tests on existing cluster
234-
$(GINKGO) $(E2E_FLAGS) -trace -vv $(FOCUS) test/catalogd-e2e
235-
236-
catalogd-e2e: KIND_CLUSTER_NAME := catalogd-e2e
237-
catalogd-e2e: ISSUER_KIND := Issuer
238-
catalogd-e2e: ISSUER_NAME := selfsigned-issuer
239-
catalogd-e2e: CATALOGD_KUSTOMIZE_BUILD_DIR := catalogd/config/overlays/e2e
240-
catalogd-e2e: run catalogd-image-registry test-catalogd-e2e ## kind-clean Run e2e test suite on local kind cluster
241229

242230
## image-registry target has to come after run-latest-release,
243231
## because the image-registry depends on the olm-ca issuer.

Diff for: catalogd/config/components/registries-conf/registries_conf_configmap.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ metadata:
66
data:
77
registries.conf: |
88
[[registry]]
9-
prefix = "docker-registry.catalogd-e2e.svc:5000"
10-
insecure = true
11-
location = "docker-registry.catalogd-e2e.svc:5000"
9+
prefix = "mirrored-registry.operator-controller-e2e.svc.cluster.local:5000"
10+
location = "docker-registry.operator-controller-e2e.svc.cluster.local:5000"

Diff for: test/catalogd-e2e/e2e_suite_test.go

-49
This file was deleted.

Diff for: test/catalogd-e2e/unpack_test.go

-105
This file was deleted.

Diff for: test/e2e/cluster_extension_install_test.go

+31
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,40 @@ func testInit(t *testing.T) (*ocv1.ClusterExtension, *catalogd.ClusterCatalog, *
210210

211211
sa, err := createServiceAccount(context.Background(), name, clusterExtensionName)
212212
require.NoError(t, err)
213+
214+
validateCatalogUnpack(t)
215+
213216
return clusterExtension, extensionCatalog, sa, ns
214217
}
215218

219+
func validateCatalogUnpack(t *testing.T) {
220+
catalog := &catalogd.ClusterCatalog{}
221+
t.Log("Ensuring ClusterCatalog has Status.Condition of Progressing with a status == True and reason == Succeeded")
222+
require.EventuallyWithT(t, func(ct *assert.CollectT) {
223+
err := c.Get(context.Background(), types.NamespacedName{Name: testCatalogName}, catalog)
224+
assert.NoError(ct, err)
225+
cond := apimeta.FindStatusCondition(catalog.Status.Conditions, catalogd.TypeProgressing)
226+
assert.NotNil(ct, cond)
227+
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
228+
assert.Equal(ct, catalogd.ReasonSucceeded, cond.Reason)
229+
}, pollDuration, pollInterval)
230+
231+
t.Log("Checking that catalog has the expected metadata label")
232+
assert.NotNil(t, catalog.ObjectMeta.Labels)
233+
assert.Contains(t, catalog.ObjectMeta.Labels, "olm.operatorframework.io/metadata.name")
234+
assert.Equal(t, testCatalogName, catalog.ObjectMeta.Labels["olm.operatorframework.io/metadata.name"])
235+
236+
t.Log("Ensuring ClusterCatalog has Status.Condition of Type = Serving with status == True")
237+
require.EventuallyWithT(t, func(ct *assert.CollectT) {
238+
err := c.Get(context.Background(), types.NamespacedName{Name: testCatalogName}, catalog)
239+
assert.NoError(ct, err)
240+
cond := apimeta.FindStatusCondition(catalog.Status.Conditions, catalogd.TypeServing)
241+
assert.NotNil(ct, cond)
242+
assert.Equal(ct, metav1.ConditionTrue, cond.Status)
243+
assert.Equal(ct, catalogd.ReasonAvailable, cond.Reason)
244+
}, pollDuration, pollInterval)
245+
}
246+
216247
func ensureNoExtensionResources(t *testing.T, clusterExtensionName string) {
217248
ls := labels.Set{"olm.operatorframework.io/owner-name": clusterExtensionName}
218249

0 commit comments

Comments
 (0)