Skip to content

Commit 2450a37

Browse files
committed
Remove more testify assertions
1 parent b206c08 commit 2450a37

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

test/e2e/installplan_e2e_test.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2673,6 +2673,7 @@ var _ = Describe("Install Plan", func() {
26732673
ip := newInstallPlanWithDummySteps(installPlanName, ns.GetName(), operatorsv1alpha1.InstallPlanPhaseNone)
26742674
outIP, err := crc.OperatorsV1alpha1().InstallPlans(ns.GetName()).Create(context.TODO(), ip, metav1.CreateOptions{})
26752675
Expect(err).NotTo(HaveOccurred())
2676+
Expect(outIP).NotTo(BeNil())
26762677

26772678
// The status gets ignored on create so we need to update it else the InstallPlan sync ignores
26782679
// InstallPlans without any steps or bundle lookups
@@ -2682,6 +2683,7 @@ var _ = Describe("Install Plan", func() {
26822683

26832684
fetchedInstallPlan, err := fetchInstallPlanWithNamespace(GinkgoT(), crc, installPlanName, ns.GetName(), buildInstallPlanPhaseCheckFunc(operatorsv1alpha1.InstallPlanPhaseFailed))
26842685
Expect(err).NotTo(HaveOccurred())
2686+
Expect(fetchedInstallPlan).NotTo(BeNil())
26852687
ctx.Ctx().Logf(fmt.Sprintf("Install plan %s fetched with phase %s", fetchedInstallPlan.GetName(), fetchedInstallPlan.Status.Phase))
26862688
ctx.Ctx().Logf(fmt.Sprintf("Install plan %s fetched with conditions %+v", fetchedInstallPlan.GetName(), fetchedInstallPlan.Status.Conditions))
26872689
})
@@ -2699,7 +2701,8 @@ var _ = Describe("Install Plan", func() {
26992701
Expect(err).NotTo(HaveOccurred())
27002702
deleteOpts := &metav1.DeleteOptions{}
27012703
defer func() {
2702-
require.NoError(GinkgoT(), c.KubernetesInterface().CoreV1().Namespaces().Delete(context.TODO(), ns.GetName(), *deleteOpts))
2704+
err = c.KubernetesInterface().CoreV1().Namespaces().Delete(context.TODO(), ns.GetName(), *deleteOpts)
2705+
Expect(err).ToNot(HaveOccurred())
27032706
}()
27042707

27052708
// Create 2 operatorgroups in the same namespace
@@ -2728,6 +2731,7 @@ var _ = Describe("Install Plan", func() {
27282731
ip := newInstallPlanWithDummySteps(installPlanName, ns.GetName(), operatorsv1alpha1.InstallPlanPhaseNone)
27292732
outIP, err := crc.OperatorsV1alpha1().InstallPlans(ns.GetName()).Create(context.TODO(), ip, metav1.CreateOptions{})
27302733
Expect(err).NotTo(HaveOccurred())
2734+
Expect(outIP).NotTo(BeNil())
27312735

27322736
// The status gets ignored on create so we need to update it else the InstallPlan sync ignores
27332737
// InstallPlans without any steps or bundle lookups
@@ -2736,7 +2740,8 @@ var _ = Describe("Install Plan", func() {
27362740
Expect(err).NotTo(HaveOccurred())
27372741

27382742
fetchedInstallPlan, err := fetchInstallPlanWithNamespace(GinkgoT(), crc, installPlanName, ns.GetName(), buildInstallPlanPhaseCheckFunc(operatorsv1alpha1.InstallPlanPhaseFailed))
2739-
require.NoError(GinkgoT(), err)
2743+
Expect(err).ToNot(HaveOccurred())
2744+
Expect(fetchedInstallPlan).NotTo(BeNil())
27402745
ctx.Ctx().Logf(fmt.Sprintf("Install plan %s fetched with status %s", fetchedInstallPlan.GetName(), fetchedInstallPlan.Status.Phase))
27412746
ctx.Ctx().Logf(fmt.Sprintf("Install plan %s fetched with conditions %+v", fetchedInstallPlan.GetName(), fetchedInstallPlan.Status.Conditions))
27422747
})
@@ -2754,7 +2759,8 @@ var _ = Describe("Install Plan", func() {
27542759
Expect(err).NotTo(HaveOccurred())
27552760
deleteOpts := &metav1.DeleteOptions{}
27562761
defer func() {
2757-
require.NoError(GinkgoT(), c.KubernetesInterface().CoreV1().Namespaces().Delete(context.TODO(), ns.GetName(), *deleteOpts))
2762+
err = c.KubernetesInterface().CoreV1().Namespaces().Delete(context.TODO(), ns.GetName(), *deleteOpts)
2763+
Expect(err).ToNot(HaveOccurred())
27582764
}()
27592765

27602766
// OperatorGroup with serviceaccount specified
@@ -2769,6 +2775,7 @@ var _ = Describe("Install Plan", func() {
27692775
}
27702776
og, err = crc.OperatorsV1().OperatorGroups(ns.GetName()).Create(context.TODO(), og, metav1.CreateOptions{})
27712777
Expect(err).ToNot(HaveOccurred())
2778+
Expect(og).NotTo(BeNil())
27722779

27732780
// Update OperatorGroup status with namespace but no service account reference
27742781
now := metav1.Now()
@@ -2784,6 +2791,7 @@ var _ = Describe("Install Plan", func() {
27842791
ip := newInstallPlanWithDummySteps(installPlanName, ns.GetName(), operatorsv1alpha1.InstallPlanPhaseNone)
27852792
outIP, err := crc.OperatorsV1alpha1().InstallPlans(ns.GetName()).Create(context.TODO(), ip, metav1.CreateOptions{})
27862793
Expect(err).NotTo(HaveOccurred())
2794+
Expect(outIP).NotTo(BeNil())
27872795

27882796
// The status gets ignored on create so we need to update it else the InstallPlan sync ignores
27892797
// InstallPlans without any steps or bundle lookups
@@ -2793,6 +2801,7 @@ var _ = Describe("Install Plan", func() {
27932801

27942802
fetchedInstallPlan, err := fetchInstallPlanWithNamespace(GinkgoT(), crc, installPlanName, ns.GetName(), buildInstallPlanPhaseCheckFunc(operatorsv1alpha1.InstallPlanPhaseFailed))
27952803
Expect(err).NotTo(HaveOccurred())
2804+
Expect(fetchedInstallPlan).NotTo(BeNil())
27962805
ctx.Ctx().Logf(fmt.Sprintf("Install plan %s fetched with status %s", fetchedInstallPlan.GetName(), fetchedInstallPlan.Status.Phase))
27972806
ctx.Ctx().Logf(fmt.Sprintf("Install plan %s fetched with conditions %+v", fetchedInstallPlan.GetName(), fetchedInstallPlan.Status.Conditions))
27982807
})

0 commit comments

Comments
 (0)