Skip to content

Commit

Permalink
Remove BeTrue patterns from e2e tests (#157)
Browse files Browse the repository at this point in the history
These Gomega patterns are hard to debug, remove these in favour of
`Equal` calls.
  • Loading branch information
okokes-akamai authored Jan 3, 2024
1 parent af0a0b4 commit 8c37946
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions e2e/test/ccm_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,59 +170,59 @@ var _ = Describe("e2e tests", func() {

if args.checkType != "" {
By("Checking Health Check Type")
Expect(string(nbConfig.Check) == args.checkType).Should(BeTrue())
Expect(string(nbConfig.Check)).To(Equal(args.checkType))
}

if args.path != "" {
By("Checking Health Check Path")
Expect(nbConfig.CheckPath == args.path).Should(BeTrue())
Expect(nbConfig.CheckPath).To(Equal(args.path))
}

if args.body != "" {
By("Checking Health Check Body")
Expect(nbConfig.CheckBody == args.body).Should(BeTrue())
Expect(nbConfig.CheckBody).To(Equal(args.body))
}

if args.interval != "" {
By("Checking TCP Connection Health Check Body")
intInterval, err := strconv.Atoi(args.interval)
Expect(err).NotTo(HaveOccurred())

Expect(nbConfig.CheckInterval == intInterval).Should(BeTrue())
Expect(nbConfig.CheckInterval).To(Equal(intInterval))
}

if args.timeout != "" {
By("Checking TCP Connection Health Check Timeout")
intTimeout, err := strconv.Atoi(args.timeout)
Expect(err).NotTo(HaveOccurred())

Expect(nbConfig.CheckTimeout == intTimeout).Should(BeTrue())
Expect(nbConfig.CheckTimeout).To(Equal(intTimeout))
}

if args.attempts != "" {
By("Checking TCP Connection Health Check Attempts")
intAttempts, err := strconv.Atoi(args.attempts)
Expect(err).NotTo(HaveOccurred())

Expect(nbConfig.CheckAttempts == intAttempts).Should(BeTrue())
Expect(nbConfig.CheckAttempts).To(Equal(intAttempts))
}

if args.checkPassive != "" {
By("Checking for Passive Health Check")
boolCheckPassive, err := strconv.ParseBool(args.checkPassive)
Expect(err).NotTo(HaveOccurred())

Expect(nbConfig.CheckPassive == boolCheckPassive).Should(BeTrue())
Expect(nbConfig.CheckPassive).To(Equal(boolCheckPassive))
}

if args.protocol != "" {
By("Checking for Protocol")
Expect(string(nbConfig.Protocol) == args.protocol).Should(BeTrue())
Expect(string(nbConfig.Protocol)).To(Equal(args.protocol))
}

if args.proxyProtocol != "" {
By("Checking for Proxy Protocol")
Expect(string(nbConfig.ProxyProtocol) == args.proxyProtocol).Should(BeTrue())
Expect(string(nbConfig.ProxyProtocol)).To(Equal(args.proxyProtocol))
}

if args.checkNodes {
Expand Down

0 comments on commit 8c37946

Please sign in to comment.