Skip to content

Commit 4a773e2

Browse files
author
Mikalai Radchuk
committedMar 31, 2023
WIP: catalog e2e
Signed-off-by: Mikalai Radchuk <[email protected]>
1 parent 8eb6ae1 commit 4a773e2

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed
 

Diff for: ‎test/e2e/catalog_e2e_test.go

+13-13
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
10101010

10111011
catSrcImage := "quay.io/olmtest/busybox-dependencies-index"
10121012

1013-
// Create gRPC CatalogSource
1013+
By("creating gRPC CatalogSource")
10141014
source := &v1alpha1.CatalogSource{
10151015
TypeMeta: metav1.TypeMeta{
10161016
Kind: v1alpha1.CatalogSourceKind,
@@ -1028,30 +1028,29 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
10281028
},
10291029
},
10301030
}
1031-
10321031
source, err := crc.OperatorsV1alpha1().CatalogSources(source.GetNamespace()).Create(context.Background(), source, metav1.CreateOptions{})
10331032
Expect(err).ShouldNot(HaveOccurred())
10341033
defer func() {
10351034
err := crc.OperatorsV1alpha1().CatalogSources(source.GetNamespace()).Delete(context.Background(), source.GetName(), metav1.DeleteOptions{})
10361035
Expect(err).ShouldNot(HaveOccurred())
10371036
}()
10381037

1039-
// Wait for the CatalogSource to be ready
1038+
By("waiting for the CatalogSource to be ready")
10401039
_, err = fetchCatalogSourceOnStatus(crc, source.GetName(), source.GetNamespace(), catalogSourceRegistryPodSynced)
10411040
Expect(err).ToNot(HaveOccurred(), "catalog source did not become ready")
10421041

1043-
// Create a Subscription for busybox
1042+
By("creating a Subscription for busybox")
10441043
subscriptionName := genName("sub-")
10451044
cleanupSubscription := createSubscriptionForCatalog(crc, source.GetNamespace(), subscriptionName, source.GetName(), packageName, channelName, "", v1alpha1.ApprovalAutomatic)
10461045
defer cleanupSubscription()
10471046

1048-
// Wait for the Subscription to succeed
1047+
By("waiting for the Subscription to succeed")
10491048
subscription, err := fetchSubscription(crc, ns.GetName(), subscriptionName, subscriptionStateAtLatestChecker)
10501049
Expect(err).ShouldNot(HaveOccurred())
10511050
Expect(subscription).ShouldNot(BeNil())
10521051
Expect(subscription.Status.InstalledCSV).To(Equal("busybox.v1.0.0"))
10531052

1054-
// Confirm that a subscription was created for busybox-dependency
1053+
By("confirming that a subscription was created for busybox-dependency")
10551054
subscriptionList, err := crc.OperatorsV1alpha1().Subscriptions(source.GetNamespace()).List(context.Background(), metav1.ListOptions{})
10561055
Expect(err).ShouldNot(HaveOccurred())
10571056
dependencySubscriptionName := ""
@@ -1062,13 +1061,13 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
10621061
}
10631062
Expect(dependencySubscriptionName).ToNot(BeEmpty())
10641063

1065-
// Wait for the Subscription to succeed
1064+
By("waiting for the Subscription to succeed")
10661065
subscription, err = fetchSubscription(crc, ns.GetName(), dependencySubscriptionName, subscriptionStateAtLatestChecker)
10671066
Expect(err).ShouldNot(HaveOccurred())
10681067
Expect(subscription).ShouldNot(BeNil())
10691068
Expect(subscription.Status.InstalledCSV).To(Equal("busybox-dependency.v1.0.0"))
10701069

1071-
// Update the catalog image
1070+
By("updating the catalog image")
10721071
Eventually(func() error {
10731072
existingSource, err := crc.OperatorsV1alpha1().CatalogSources(source.GetNamespace()).Get(context.Background(), sourceName, metav1.GetOptions{})
10741073
if err != nil {
@@ -1080,32 +1079,32 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
10801079
return err
10811080
}).Should(Succeed())
10821081

1083-
// Wait for the CatalogSource to be ready
1082+
By("waiting for the CatalogSource to be ready")
10841083
_, err = fetchCatalogSourceOnStatus(crc, source.GetName(), source.GetNamespace(), catalogSourceRegistryPodSynced)
10851084
Expect(err).ToNot(HaveOccurred(), "catalog source did not become ready")
10861085

1087-
// Wait for the busybox v2 Subscription to succeed
1086+
By("waiting for the busybox v2 Subscription to succeed")
10881087
subChecker := func(sub *v1alpha1.Subscription) bool {
10891088
return sub.Status.InstalledCSV == "busybox.v2.0.0"
10901089
}
10911090
subscription, err = fetchSubscription(crc, ns.GetName(), subscriptionName, subChecker)
10921091
Expect(err).ShouldNot(HaveOccurred())
10931092
Expect(subscription).ShouldNot(BeNil())
10941093

1095-
// Wait for busybox v2 csv to succeed and check the replaces field
1094+
By("waiting for busybox v2 csv to succeed and check the replaces field")
10961095
csv, err := fetchCSV(crc, subscription.Status.CurrentCSV, subscription.GetNamespace(), csvSucceededChecker)
10971096
Expect(err).ShouldNot(HaveOccurred())
10981097
Expect(csv.Spec.Replaces).To(Equal("busybox.v1.0.0"))
10991098

1100-
// Wait for the busybox-dependency v2 Subscription to succeed
1099+
By("waiting for the busybox-dependency v2 Subscription to succeed")
11011100
subChecker = func(sub *v1alpha1.Subscription) bool {
11021101
return sub.Status.InstalledCSV == "busybox-dependency.v2.0.0"
11031102
}
11041103
subscription, err = fetchSubscription(crc, ns.GetName(), dependencySubscriptionName, subChecker)
11051104
Expect(err).ShouldNot(HaveOccurred())
11061105
Expect(subscription).ShouldNot(BeNil())
11071106

1108-
// Wait for busybox-dependency v2 csv to succeed and check the replaces field
1107+
By("waiting for busybox-dependency v2 csv to succeed and check the replaces field")
11091108
csv, err = fetchCSV(crc, subscription.Status.CurrentCSV, subscription.GetNamespace(), csvSucceededChecker)
11101109
Expect(err).ShouldNot(HaveOccurred())
11111110
Expect(csv.Spec.Replaces).To(Equal("busybox-dependency.v1.0.0"))
@@ -1403,6 +1402,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
14031402
Expect(c.Create(context.Background(), subscription)).To(BeNil())
14041403
})
14051404

1405+
// TODO: Sort this out. Probably need to change the implementation to expose this on sub now.
14061406
It("fails with a ResolutionFailed error condition, and a message that highlights the missing field in the CSV", func() {
14071407

14081408
subscription, err := fetchSubscription(crc, subscription.GetNamespace(), subscription.GetName(), subscriptionHasInstallPlanChecker)

0 commit comments

Comments
 (0)
Please sign in to comment.