Skip to content

Simplify HTTP response assertions in tests #1992

Open
@pleshakov

Description

@pleshakov

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogCurrently unprioritized work. May change with user feedback or as the product progresses.good first issueGood for newcomerstech-debtShort-term pain, long-term benefittestsPull requests that update tests

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions