nginx-gateway-fabric icon indicating copy to clipboard operation
nginx-gateway-fabric copied to clipboard

Simplify HTTP response assertions in tests

Open pleshakov opened this issue 1 year ago • 1 comments

In our tests, we often inspect the response of an HTTP request.

Example 1 https://github.com/nginxinc/nginx-gateway-fabric/blob/2cd63e7e82729bdccda445f44db2f8eaec00ba38/tests/suite/graceful_recovery_test.go#L220

Example 2 https://github.com/nginxinc/nginx-gateway-fabric/blob/2cd63e7e82729bdccda445f44db2f8eaec00ba38/tests/scale/scale_test.go#L250

Gomega provides matches for HTTP response -- https://onsi.github.io/gomega/#working-with-http-responses

Acceptance criteria:

  • Simplify response assertions by using Gomega specialized matchers.

pleshakov avatar May 17 '24 20:05 pleshakov