Skip to content

Commit 5dc2e63

Browse files
Merge pull request #1631 from exdx/fix/bundle-objects-test
fix: check installplan status in bundle e2e test
2 parents b77ca31 + 37b2d42 commit 5dc2e63

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

test/e2e/bundle_e2e_test.go

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ package e2e
22

33
import (
44
"context"
5-
"k8s.io/apimachinery/pkg/runtime/schema"
6-
"k8s.io/client-go/dynamic"
75

86
. "github.com/onsi/ginkgo"
97
. "github.com/onsi/gomega"
8+
109
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
10+
"k8s.io/apimachinery/pkg/runtime/schema"
11+
"k8s.io/client-go/dynamic"
1112

1213
"github.com/operator-framework/api/pkg/operators/v1alpha1"
1314
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned"
@@ -45,6 +46,8 @@ var _ = Describe("Installing bundles with new object types", func() {
4546
sourceName = "test-catalog"
4647
imageName = "quay.io/olmtest/single-bundle-index:pdb"
4748
)
49+
50+
var installPlanRef string
4851
// create catalog source
4952
source := &v1alpha1.CatalogSource{
5053
TypeMeta: metav1.TypeMeta{
@@ -69,10 +72,16 @@ var _ = Describe("Installing bundles with new object types", func() {
6972
_ = createSubscriptionForCatalog(operatorClient, source.GetNamespace(), subName, source.GetName(), packageName, channelName, "", v1alpha1.ApprovalAutomatic)
7073

7174
// Wait for the Subscription to succeed
72-
Eventually(func() error {
73-
_, err = fetchSubscription(operatorClient, testNamespace, subName, subscriptionStateAtLatestChecker)
74-
return err
75-
}).Should(BeNil())
75+
sub, err := fetchSubscription(operatorClient, testNamespace, subName, subscriptionStateAtLatestChecker)
76+
Expect(err).ToNot(HaveOccurred(), "could not get subscription at latest status")
77+
78+
installPlanRef = sub.Status.InstallPlanRef.Name
79+
80+
// Wait for the installplan to complete (5 minute timeout)
81+
_, err = fetchInstallPlan(GinkgoT(), operatorClient, installPlanRef, buildInstallPlanPhaseCheckFunc(v1alpha1.InstallPlanPhaseComplete))
82+
Expect(err).ToNot(HaveOccurred(), "could not get installplan at complete phase")
83+
84+
ctx.Ctx().Logf("install plan %s completed", installPlanRef)
7685
})
7786

7887
It("should create the additional bundle objects", func() {

0 commit comments

Comments
 (0)