Skip to content

Conformance Helpers Should be Cleaned Up #1728

@robscott

Description

@robscott

What would you like to be added:
We currently have some duplicative methods that really should be unified before we add conformance tests for more types. For example, the following functions have significant overlap:

  1. GatewayAndHTTPRoutesMustBeAccepted + GatewayAndTLSRoutesMustBeAccepted

    func GatewayAndHTTPRoutesMustBeAccepted(t *testing.T, c client.Client, timeoutConfig config.TimeoutConfig, controllerName string, gw GatewayRef, routeNNs ...types.NamespacedName) string {

    func GatewayAndTLSRoutesMustBeAccepted(t *testing.T, c client.Client, timeoutConfig config.TimeoutConfig, controllerName string, gw GatewayRef, routeNNs ...types.NamespacedName) (string, []v1beta1.Hostname) {

  2. HTTPRouteMustHaveParents + TLSRouteMustHaveParents

    func HTTPRouteMustHaveParents(t *testing.T, client client.Client, timeoutConfig config.TimeoutConfig, routeName types.NamespacedName, parents []v1beta1.RouteParentStatus, namespaceRequired bool) {

    func TLSRouteMustHaveParents(t *testing.T, client client.Client, timeoutConfig config.TimeoutConfig, routeName types.NamespacedName, parents []v1alpha2.RouteParentStatus, namespaceRequired bool) v1alpha2.TLSRoute {

Why this is needed:
Our conformance tests have grown organically over the years. Although each change made sense in isolation, these changes have resulted in a high likelihood that we'll start to have unexpected variations between tests for different route types.

Note: This is going to be complex to resolve, it would likely be good for someone that already has experience writing and/or running conformance tests to work on this. It may also be good to agree on a direction in this issue before investing too much time in writing code for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/conformance-machineryIssues or PRs related to the machinery and the suite used to run conformance tests.kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions