Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffmaen committed Dec 12, 2024
1 parent 2b89f38 commit efa7e82
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions proxy/round_tripper/proxy_round_tripper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ var _ = Describe("ProxyRoundTripper", func() {
Context("when there are no more endpoints available", func() {
JustBeforeEach(func() {
removed := routePool.Remove(endpoint)
Expect(removed).To(BeTrue())
Expect(removed).To(Equal(route.EndpointUnregistered))
})

It("returns a 502 Bad Gateway response", func() {
Expand Down Expand Up @@ -1147,7 +1147,7 @@ var _ = Describe("ProxyRoundTripper", func() {
added = routePool.Put(endpoint2)
Expect(added).To(Equal(route.Added))
removed := routePool.Remove(endpoint)
Expect(removed).To(BeTrue())
Expect(removed).To(Equal(route.EndpointUnregistered))
})

Context("when there are no cookies on the request", func() {
Expand Down Expand Up @@ -1439,10 +1439,10 @@ var _ = Describe("ProxyRoundTripper", func() {

JustBeforeEach(func() {
removed := routePool.Remove(endpoint1)
Expect(removed).To(BeTrue())
Expect(removed).To(Equal(route.EndpointUnregistered))

removed = routePool.Remove(endpoint2)
Expect(removed).To(BeTrue())
Expect(removed).To(Equal(route.EndpointUnregistered))

new_endpoint := route.NewEndpoint(&route.EndpointOpts{PrivateInstanceId: "id-5"})
added := routePool.Put(new_endpoint)
Expand Down Expand Up @@ -1502,10 +1502,10 @@ var _ = Describe("ProxyRoundTripper", func() {

JustBeforeEach(func() {
removed := routePool.Remove(endpoint1)
Expect(removed).To(BeTrue())
Expect(removed).To(Equal(route.EndpointUnregistered))

removed = routePool.Remove(endpoint2)
Expect(removed).To(BeTrue())
Expect(removed).To(Equal(route.EndpointUnregistered))

new_endpoint := route.NewEndpoint(&route.EndpointOpts{PrivateInstanceId: "id-5"})
added := routePool.Put(new_endpoint)
Expand Down Expand Up @@ -1568,10 +1568,10 @@ var _ = Describe("ProxyRoundTripper", func() {

JustBeforeEach(func() {
removed := routePool.Remove(endpoint1)
Expect(removed).To(BeTrue())
Expect(removed).To(Equal(route.EndpointUnregistered))

removed = routePool.Remove(endpoint2)
Expect(removed).To(BeTrue())
Expect(removed).To(Equal(route.EndpointUnregistered))

new_endpoint := route.NewEndpoint(&route.EndpointOpts{PrivateInstanceId: "id-5"})
added := routePool.Put(new_endpoint)
Expand Down
8 changes: 4 additions & 4 deletions registry/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ var _ = Describe("RouteRegistry", func() {
Expect(reporter.CaptureRegistryMessageCallCount()).To(Equal(1))
endpoint1, action1 := reporter.CaptureRegistryMessageArgsForCall(0)
Expect(endpoint1).To(Equal(fooEndpoint))
Expect(action1).To(Equal("endpoint-registered"))
Expect(action1).To(Equal("endpoint-added"))
})
})

Expand All @@ -91,7 +91,7 @@ var _ = Describe("RouteRegistry", func() {
Expect(reporter.CaptureRegistryMessageCallCount()).To(Equal(2))
endpointR1, action1 := reporter.CaptureRegistryMessageArgsForCall(0)
Expect(endpointR1).To(Equal(endpoint1))
Expect(action1).To(Equal("endpoint-registered"))
Expect(action1).To(Equal("endpoint-added"))
endpointR2, action2 := reporter.CaptureRegistryMessageArgsForCall(1)
Expect(endpointR2).To(Equal(endpoint2))
Expect(action2).To(Equal("endpoint-updated"))
Expand All @@ -109,7 +109,7 @@ var _ = Describe("RouteRegistry", func() {
Expect(reporter.CaptureRegistryMessageCallCount()).To(Equal(2))
endpointR1, action1 := reporter.CaptureRegistryMessageArgsForCall(0)
Expect(endpointR1).To(Equal(endpoint1))
Expect(action1).To(Equal("endpoint-registered"))
Expect(action1).To(Equal("endpoint-added"))
endpointR2, action2 := reporter.CaptureRegistryMessageArgsForCall(1)
Expect(endpointR2).To(Equal(endpoint2))
Expect(action2).To(Equal("endpoint-not-updated"))
Expand Down Expand Up @@ -278,7 +278,7 @@ var _ = Describe("RouteRegistry", func() {
r.Register("a.route", fooEndpoint)

Eventually(logger).Should(gbytes.Say(`"log_level":1.*route-registered.*a\.route`))
Eventually(logger).Should(gbytes.Say(`"log_level":1.*endpoint-registered.*a\.route.*192\.168\.1\.1`))
Eventually(logger).Should(gbytes.Say(`"log_level":1.*endpoint-added.*a\.route.*192\.168\.1\.1`))
})

It("logs 'uri-added' at debug level for backward compatibility", func() {
Expand Down

0 comments on commit efa7e82

Please sign in to comment.