Skip to content

Clean up duplicate listers for testing, have a good structure of testing package, make it consistent among all resources. #3629

@capri-xiyue

Description

@capri-xiyue

Problem
In knative-eventing, we have three files which define listers:
https://github.com/knative/eventing/blob/master/pkg/reconciler/testing/v1/listers.go
https://github.com/knative/eventing/blob/master/pkg/reconciler/testing/v1beta1/listers.go and
https://github.com/knative/eventing/blob/master/pkg/reconciler/testing/listers.go.
Some listers are duplicate among those three files. Some resources uses listers under pkg/testing/v1beta1, some resources use listers under /testing, some resources uses listers under pkg/testing/v1.
I guess
pkg/testing/v1 is for v1 resources and
pkg/testing/v1beta1 is for v1beta1 resources and
pkg/testing was at first for v1alpha1 resources.

But now the code style is not consistent.

In addition, for example, broker test helper methods follows such package naming example(https://github.com/knative/eventing/blob/master/pkg/reconciler/testing/v1/broker.go and https://github.com/knative/eventing/tree/master/pkg/reconciler/testing/v1beta1) but source test helper methods don't(https://github.com/knative/eventing/blob/master/pkg/reconciler/testing/sinkbinding.go)
It will be better if we can clean up duplicate listers for testing, and have a good structure of testing package, make it consistent among the codebases

Persona:
Which persona is this feature for?

Exit Criteria
Clean up duplicate listers for testing

Time Estimate (optional):
How many developer-days do you think this may take to resolve?

Additional context (optional)
Add any other context about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/feature-requestlifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.priority/awaiting-more-evidenceLowest priority. Possibly useful, but not yet enough support to actually get it done.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions