@@ -1010,7 +1010,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
1010
1010
1011
1011
catSrcImage := "quay.io/olmtest/busybox-dependencies-index"
1012
1012
1013
- // Create gRPC CatalogSource
1013
+ By ( "creating gRPC CatalogSource" )
1014
1014
source := & v1alpha1.CatalogSource {
1015
1015
TypeMeta : metav1.TypeMeta {
1016
1016
Kind : v1alpha1 .CatalogSourceKind ,
@@ -1028,30 +1028,29 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
1028
1028
},
1029
1029
},
1030
1030
}
1031
-
1032
1031
source , err := crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Create (context .Background (), source , metav1.CreateOptions {})
1033
1032
Expect (err ).ShouldNot (HaveOccurred ())
1034
1033
defer func () {
1035
1034
err := crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Delete (context .Background (), source .GetName (), metav1.DeleteOptions {})
1036
1035
Expect (err ).ShouldNot (HaveOccurred ())
1037
1036
}()
1038
1037
1039
- // Wait for the CatalogSource to be ready
1038
+ By ( "waiting for the CatalogSource to be ready" )
1040
1039
_ , err = fetchCatalogSourceOnStatus (crc , source .GetName (), source .GetNamespace (), catalogSourceRegistryPodSynced )
1041
1040
Expect (err ).ToNot (HaveOccurred (), "catalog source did not become ready" )
1042
1041
1043
- // Create a Subscription for busybox
1042
+ By ( "creating a Subscription for busybox" )
1044
1043
subscriptionName := genName ("sub-" )
1045
1044
cleanupSubscription := createSubscriptionForCatalog (crc , source .GetNamespace (), subscriptionName , source .GetName (), packageName , channelName , "" , v1alpha1 .ApprovalAutomatic )
1046
1045
defer cleanupSubscription ()
1047
1046
1048
- // Wait for the Subscription to succeed
1047
+ By ( "waiting for the Subscription to succeed" )
1049
1048
subscription , err := fetchSubscription (crc , ns .GetName (), subscriptionName , subscriptionStateAtLatestChecker )
1050
1049
Expect (err ).ShouldNot (HaveOccurred ())
1051
1050
Expect (subscription ).ShouldNot (BeNil ())
1052
1051
Expect (subscription .Status .InstalledCSV ).To (Equal ("busybox.v1.0.0" ))
1053
1052
1054
- // Confirm that a subscription was created for busybox-dependency
1053
+ By ( "confirming that a subscription was created for busybox-dependency" )
1055
1054
subscriptionList , err := crc .OperatorsV1alpha1 ().Subscriptions (source .GetNamespace ()).List (context .Background (), metav1.ListOptions {})
1056
1055
Expect (err ).ShouldNot (HaveOccurred ())
1057
1056
dependencySubscriptionName := ""
@@ -1062,13 +1061,13 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
1062
1061
}
1063
1062
Expect (dependencySubscriptionName ).ToNot (BeEmpty ())
1064
1063
1065
- // Wait for the Subscription to succeed
1064
+ By ( "waiting for the Subscription to succeed" )
1066
1065
subscription , err = fetchSubscription (crc , ns .GetName (), dependencySubscriptionName , subscriptionStateAtLatestChecker )
1067
1066
Expect (err ).ShouldNot (HaveOccurred ())
1068
1067
Expect (subscription ).ShouldNot (BeNil ())
1069
1068
Expect (subscription .Status .InstalledCSV ).To (Equal ("busybox-dependency.v1.0.0" ))
1070
1069
1071
- // Update the catalog image
1070
+ By ( "updating the catalog image" )
1072
1071
Eventually (func () error {
1073
1072
existingSource , err := crc .OperatorsV1alpha1 ().CatalogSources (source .GetNamespace ()).Get (context .Background (), sourceName , metav1.GetOptions {})
1074
1073
if err != nil {
@@ -1080,32 +1079,32 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
1080
1079
return err
1081
1080
}).Should (Succeed ())
1082
1081
1083
- // Wait for the CatalogSource to be ready
1082
+ By ( "waiting for the CatalogSource to be ready" )
1084
1083
_ , err = fetchCatalogSourceOnStatus (crc , source .GetName (), source .GetNamespace (), catalogSourceRegistryPodSynced )
1085
1084
Expect (err ).ToNot (HaveOccurred (), "catalog source did not become ready" )
1086
1085
1087
- // Wait for the busybox v2 Subscription to succeed
1086
+ By ( "waiting for the busybox v2 Subscription to succeed" )
1088
1087
subChecker := func (sub * v1alpha1.Subscription ) bool {
1089
1088
return sub .Status .InstalledCSV == "busybox.v2.0.0"
1090
1089
}
1091
1090
subscription , err = fetchSubscription (crc , ns .GetName (), subscriptionName , subChecker )
1092
1091
Expect (err ).ShouldNot (HaveOccurred ())
1093
1092
Expect (subscription ).ShouldNot (BeNil ())
1094
1093
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" )
1096
1095
csv , err := fetchCSV (crc , subscription .Status .CurrentCSV , subscription .GetNamespace (), csvSucceededChecker )
1097
1096
Expect (err ).ShouldNot (HaveOccurred ())
1098
1097
Expect (csv .Spec .Replaces ).To (Equal ("busybox.v1.0.0" ))
1099
1098
1100
- // Wait for the busybox-dependency v2 Subscription to succeed
1099
+ By ( "waiting for the busybox-dependency v2 Subscription to succeed" )
1101
1100
subChecker = func (sub * v1alpha1.Subscription ) bool {
1102
1101
return sub .Status .InstalledCSV == "busybox-dependency.v2.0.0"
1103
1102
}
1104
1103
subscription , err = fetchSubscription (crc , ns .GetName (), dependencySubscriptionName , subChecker )
1105
1104
Expect (err ).ShouldNot (HaveOccurred ())
1106
1105
Expect (subscription ).ShouldNot (BeNil ())
1107
1106
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" )
1109
1108
csv , err = fetchCSV (crc , subscription .Status .CurrentCSV , subscription .GetNamespace (), csvSucceededChecker )
1110
1109
Expect (err ).ShouldNot (HaveOccurred ())
1111
1110
Expect (csv .Spec .Replaces ).To (Equal ("busybox-dependency.v1.0.0" ))
@@ -1403,21 +1402,16 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
1403
1402
Expect (c .Create (context .Background (), subscription )).To (BeNil ())
1404
1403
})
1405
1404
1406
- It ("fails with a ResolutionFailed error condition, and a message that highlights the missing field in the CSV" , func () {
1407
-
1408
- subscription , err := fetchSubscription (crc , subscription .GetNamespace (), subscription .GetName (), subscriptionHasInstallPlanChecker )
1409
- Expect (err ).Should (BeNil ())
1410
- installPlanName := subscription .Status .Install .Name
1405
+ It ("fails with a BundleUnpackFailed error condition, and a message that highlights the missing field in the CSV" , func () {
1406
+ Eventually (func (g Gomega ) error {
1407
+ fetchedSubscription , err := crc .OperatorsV1alpha1 ().Subscriptions (ns .GetName ()).Get (context .Background (), subscription .GetName (), metav1.GetOptions {})
1408
+ g .Expect (err ).NotTo (HaveOccurred ())
1411
1409
1412
- // ensure we wait for the installPlan to fail before moving forward then fetch the subscription again
1413
- _ , err = fetchInstallPlan (GinkgoT (), crc , installPlanName , subscription .GetNamespace (), buildInstallPlanPhaseCheckFunc (operatorsv1alpha1 .InstallPlanPhaseFailed ))
1414
- Expect (err ).To (BeNil ())
1415
- subscription , err = fetchSubscription (crc , subscription .GetNamespace (), subscription .GetName (), subscriptionHasInstallPlanChecker )
1416
- Expect (err ).To (BeNil ())
1417
-
1418
- // expect the message that API missing
1419
- failingCondition := subscription .Status .GetCondition (operatorsv1alpha1 .SubscriptionInstallPlanFailed )
1420
- Expect (failingCondition .Message ).To (ContainSubstring ("missing APIVersion" ))
1410
+ // expect the message that API missing
1411
+ failingCondition := fetchedSubscription .Status .GetCondition (v1alpha1 .SubscriptionBundleUnpackFailed )
1412
+ g .Expect (failingCondition .Message ).To (ContainSubstring ("missing APIVersion" ))
1413
+ return nil
1414
+ }).Should (BeNil ())
1421
1415
})
1422
1416
})
1423
1417
})
0 commit comments