e2e: replace gomega.Equal(true/false) with gomega.BeTrue/BeFalse()
The failure message becomes a bit nicer. Found by the new ginkgolinter, for
example:
    test/e2e/windows/memory_limits.go:160:2: ginkgo-linter: wrong boolean assertion; consider using `gomega.Eventually(ctx, func() bool {
     eventList, err := f.ClientSet.CoreV1().Events(f.Namespace.Name).List(ctx, metav1.ListOptions{})
     ...
    }, 3*time.Minute, 10*time.Second).Should(gomega.BeTrue())` instead (ginkgolinter)
			
			
This commit is contained in:
		@@ -168,7 +168,7 @@ func overrideAllocatableMemoryTest(ctx context.Context, f *framework.Framework,
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		return false
 | 
			
		||||
	}, 3*time.Minute, 10*time.Second).Should(gomega.Equal(true))
 | 
			
		||||
	}, 3*time.Minute, 10*time.Second).Should(gomega.BeTrue())
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -227,7 +227,7 @@ var _ = SIGDescribe("HugePages [Serial] [Feature:HugePages][NodeSpecialFeature:H
 | 
			
		||||
			framework.ExpectNoError(err, "while getting node status")
 | 
			
		||||
			_, isPresent := node.Status.Capacity["hugepages-3Mi"]
 | 
			
		||||
			return isPresent
 | 
			
		||||
		}, 30*time.Second, framework.Poll).Should(gomega.Equal(false))
 | 
			
		||||
		}, 30*time.Second, framework.Poll).Should(gomega.BeFalse())
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	ginkgo.It("should add resources for new huge page sizes on kubelet restart", func(ctx context.Context) {
 | 
			
		||||
@@ -247,7 +247,7 @@ var _ = SIGDescribe("HugePages [Serial] [Feature:HugePages][NodeSpecialFeature:H
 | 
			
		||||
			framework.ExpectNoError(err, "while getting node status")
 | 
			
		||||
			_, isPresent := node.Status.Capacity["hugepages-2Mi"]
 | 
			
		||||
			return isPresent
 | 
			
		||||
		}, 30*time.Second, framework.Poll).Should(gomega.Equal(true))
 | 
			
		||||
		}, 30*time.Second, framework.Poll).Should(gomega.BeTrue())
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	ginkgo.When("start the pod", func() {
 | 
			
		||||
 
 | 
			
		||||
@@ -627,7 +627,7 @@ var _ = SIGDescribe("Memory Manager [Disruptive] [Serial] [Feature:MemoryManager
 | 
			
		||||
 | 
			
		||||
					return true
 | 
			
		||||
				}, time.Minute, 5*time.Second).Should(
 | 
			
		||||
					gomega.Equal(true),
 | 
			
		||||
					gomega.BeTrue(),
 | 
			
		||||
					"the pod succeeded to start, when it should fail with the admission error",
 | 
			
		||||
				)
 | 
			
		||||
			})
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user