Skip to content

Commit 7cb4a57

Browse files
[Monorepo]: Cleanup: Merge catalogd-e2e tests into operator-controller e2e
- 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 becde51 commit 7cb4a57

File tree

5 files changed

+32
-176
lines changed

5 files changed

+32
-176
lines changed

.github/workflows/catalogd-e2e.yaml

Lines changed: 0 additions & 9 deletions
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:

Makefile

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -223,19 +223,6 @@ test-e2e: KUSTOMIZE_BUILD_DIR := config/overlays/e2e
223223
test-e2e: GO_BUILD_FLAGS := -cover
224224
test-e2e: run image-registry e2e e2e-coverage kind-clean #HELP Run e2e test suite on local kind cluster
225225

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

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

test/catalogd-e2e/e2e_suite_test.go

Lines changed: 0 additions & 49 deletions
This file was deleted.

test/catalogd-e2e/unpack_test.go

Lines changed: 0 additions & 105 deletions
This file was deleted.

test/e2e/cluster_extension_install_test.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ func testInit(t *testing.T) (*ocv1.ClusterExtension, *catalogd.ClusterCatalog, *
200200
},
201201
}
202202

203+
// Use the same catalog image reference logic
203204
extensionCatalog, err := createTestCatalog(context.Background(), testCatalogName, os.Getenv(testCatalogRefEnvVar))
204205
require.NoError(t, err)
205206

@@ -210,9 +211,40 @@ func testInit(t *testing.T) (*ocv1.ClusterExtension, *catalogd.ClusterCatalog, *
210211

211212
sa, err := createServiceAccount(context.Background(), name, clusterExtensionName)
212213
require.NoError(t, err)
214+
215+
validateCatalogUnpack(t)
216+
213217
return clusterExtension, extensionCatalog, sa, ns
214218
}
215219

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

0 commit comments

Comments
 (0)