Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions test/e2e/installplan_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3325,15 +3325,22 @@ var _ = Describe("Install Plan", func() {
})

It("should clear clear up the condition in the InstallPlan status that contains an error message when a valid OperatorGroup is created", func() {

// first check that a condition with a message exists
fetchedInstallPlan, err := fetchInstallPlanWithNamespace(GinkgoT(), crc, installPlanName, ns.GetName(), buildInstallPlanPhaseCheckFunc(operatorsv1alpha1.InstallPlanPhaseInstalling))
Expect(err).NotTo(HaveOccurred())
Expect(fetchedInstallPlan).NotTo(BeNil())
cond := v1alpha1.InstallPlanCondition{Type: v1alpha1.InstallPlanInstalled, Status: corev1.ConditionFalse, Reason: v1alpha1.InstallPlanReasonInstallCheckFailed,
Message: "no operator group found that is managing this namespace"}
Expect(fetchedInstallPlan.Status.Phase).To(Equal(v1alpha1.InstallPlanPhaseInstalling))
Expect(hasCondition(fetchedInstallPlan, cond)).To(BeTrue())
// first check that a condition with a message exists
Eventually(func() (bool, error) {
fetchedInstallPlan, err := fetchInstallPlanWithNamespace(GinkgoT(), crc, installPlanName, ns.GetName(), buildInstallPlanPhaseCheckFunc(operatorsv1alpha1.InstallPlanPhaseInstalling))
if err != nil {
return false, err
}
if fetchedInstallPlan == nil {
return false, err
}
if hasCondition(fetchedInstallPlan, cond) {
return true, nil
}
return false, nil
Comment on lines +3333 to +3342
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can condense this legibly:

return fetchedInstallPlan != nil && hasCondition(fetchedInstallPlan, cond), err

}).Should(BeTrue())

// Create an operatorgroup for the same namespace
og := &operatorsv1.OperatorGroup{
Expand Down