Skip to content

Commit 75b496c

Browse files
committed
remove e2e catalog reconcile test
Signed-off-by: Ankita Thomas <[email protected]>
1 parent 4f8da4a commit 75b496c

File tree

1 file changed

+3
-79
lines changed

1 file changed

+3
-79
lines changed

test/e2e/install_test.go

Lines changed: 3 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
catalogd "github.com/operator-framework/catalogd/pkg/apis/core/v1beta1"
1111
operatorv1alpha1 "github.com/operator-framework/operator-controller/api/v1alpha1"
1212
rukpakv1alpha1 "github.com/operator-framework/rukpak/api/v1alpha1"
13-
"k8s.io/apimachinery/pkg/api/errors"
1413
apimeta "k8s.io/apimachinery/pkg/api/meta"
1514
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1615
"k8s.io/apimachinery/pkg/types"
@@ -58,8 +57,6 @@ var _ = Describe("Operator Install", func() {
5857
},
5958
},
6059
}
61-
})
62-
It("resolves the specified package with correct bundle path", func() {
6360
err := c.Create(ctx, operatorCatalog)
6461
Expect(err).ToNot(HaveOccurred())
6562
Eventually(func(g Gomega) {
@@ -72,9 +69,10 @@ var _ = Describe("Operator Install", func() {
7269
g.Expect(cond.Reason).To(Equal(catalogd.ReasonUnpackSuccessful))
7370
g.Expect(cond.Message).To(ContainSubstring("successfully unpacked the catalog image"))
7471
}).WithTimeout(5 * time.Minute).WithPolling(defaultPoll).Should(Succeed())
75-
72+
})
73+
It("resolves the specified package with correct bundle path", func() {
7674
By("creating the Operator resource")
77-
err = c.Create(ctx, operator)
75+
err := c.Create(ctx, operator)
7876
Expect(err).ToNot(HaveOccurred())
7977

8078
By("eventually reporting a successful resolution and bundle path")
@@ -115,86 +113,12 @@ var _ = Describe("Operator Install", func() {
115113
g.Expect(cond.Reason).To(Equal(rukpakv1alpha1.ReasonInstallationSucceeded))
116114
}).WithTimeout(defaultTimeout).WithPolling(defaultPoll).Should(Succeed())
117115
})
118-
It("resolves again when a new catalog is available", func() {
119-
Eventually(func(g Gomega) {
120-
// target package should not be present on cluster
121-
err := c.Get(ctx, types.NamespacedName{Name: pkgName}, &catalogd.Package{})
122-
Expect(errors.IsNotFound(err)).To(BeTrue())
123-
}).WithTimeout(5 * time.Minute).WithPolling(defaultPoll).Should(Succeed())
124-
125-
By("creating the Operator resource")
126-
err := c.Create(ctx, operator)
127-
Expect(err).ToNot(HaveOccurred())
128-
129-
By("failing to find Operator during resolution")
130-
Eventually(func(g Gomega) {
131-
err = c.Get(ctx, types.NamespacedName{Name: operator.Name}, operator)
132-
g.Expect(err).ToNot(HaveOccurred())
133-
cond := apimeta.FindStatusCondition(operator.Status.Conditions, operatorv1alpha1.TypeResolved)
134-
g.Expect(cond).ToNot(BeNil())
135-
g.Expect(cond.Status).To(Equal(metav1.ConditionFalse))
136-
g.Expect(cond.Reason).To(Equal(operatorv1alpha1.ReasonResolutionFailed))
137-
g.Expect(cond.Message).To(Equal(fmt.Sprintf("package '%s' not found", pkgName)))
138-
}).WithTimeout(defaultTimeout).WithPolling(defaultPoll).Should(Succeed())
139-
140-
By("creating an Operator catalog with the desired package")
141-
err = c.Create(ctx, operatorCatalog)
142-
Expect(err).ToNot(HaveOccurred())
143-
Eventually(func(g Gomega) {
144-
err = c.Get(ctx, types.NamespacedName{Name: operatorCatalog.Name}, operatorCatalog)
145-
g.Expect(err).ToNot(HaveOccurred())
146-
cond := apimeta.FindStatusCondition(operatorCatalog.Status.Conditions, catalogd.TypeUnpacked)
147-
g.Expect(cond).ToNot(BeNil())
148-
g.Expect(cond.Status).To(Equal(metav1.ConditionTrue))
149-
g.Expect(cond.Reason).To(Equal(catalogd.ReasonUnpackSuccessful))
150-
}).WithTimeout(5 * time.Minute).WithPolling(defaultPoll).Should(Succeed())
151-
152-
By("eventually resolving the package successfully")
153-
Eventually(func(g Gomega) {
154-
err = c.Get(ctx, types.NamespacedName{Name: operator.Name}, operator)
155-
g.Expect(err).ToNot(HaveOccurred())
156-
cond := apimeta.FindStatusCondition(operator.Status.Conditions, operatorv1alpha1.TypeResolved)
157-
g.Expect(cond).ToNot(BeNil())
158-
g.Expect(cond.Status).To(Equal(metav1.ConditionTrue))
159-
g.Expect(cond.Reason).To(Equal(operatorv1alpha1.ReasonSuccess))
160-
}).WithTimeout(defaultTimeout).WithPolling(defaultPoll).Should(Succeed())
161-
})
162116
AfterEach(func() {
163117
err := c.Delete(ctx, operator)
164118
Expect(err).ToNot(HaveOccurred())
165-
Eventually(func(g Gomega) {
166-
err = c.Get(ctx, types.NamespacedName{Name: operatorName}, &operatorv1alpha1.Operator{})
167-
Expect(errors.IsNotFound(err)).To(BeTrue())
168-
}).WithTimeout(defaultTimeout).WithPolling(defaultPoll).Should(Succeed())
169119

170120
err = c.Delete(ctx, operatorCatalog)
171121
Expect(err).ToNot(HaveOccurred())
172-
Eventually(func(g Gomega) {
173-
err = c.Get(ctx, types.NamespacedName{Name: operatorCatalog.Name}, &catalogd.Catalog{})
174-
Expect(errors.IsNotFound(err)).To(BeTrue())
175-
}).WithTimeout(defaultTimeout).WithPolling(defaultPoll).Should(Succeed())
176-
177-
// speed up delete without waiting for gc
178-
err = c.DeleteAllOf(ctx, &catalogd.BundleMetadata{})
179-
Expect(err).ToNot(HaveOccurred())
180-
err = c.DeleteAllOf(ctx, &catalogd.Package{})
181-
Expect(err).ToNot(HaveOccurred())
182-
183-
Eventually(func(g Gomega) {
184-
// ensure resource cleanup
185-
packages := &catalogd.PackageList{}
186-
err = c.List(ctx, packages)
187-
Expect(err).To(BeNil())
188-
Expect(packages.Items).To(BeEmpty())
189-
190-
bmd := &catalogd.BundleMetadataList{}
191-
err = c.List(ctx, bmd)
192-
Expect(err).To(BeNil())
193-
Expect(bmd.Items).To(BeEmpty())
194-
195-
err = c.Get(ctx, types.NamespacedName{Name: operatorName}, &rukpakv1alpha1.BundleDeployment{})
196-
Expect(errors.IsNotFound(err)).To(BeTrue())
197-
}).WithTimeout(5 * time.Minute).WithPolling(defaultPoll).Should(Succeed())
198122
})
199123
})
200124
})

0 commit comments

Comments
 (0)