Put all `pkg/apis/pipeline/v1beta1/*_test.go` files to `v1beta1_test` package
Feature request
Under pkg/apis/pipeline/v1beta1 folder, there are a number of *_test.go files under v1beta1 package, whereas some are under v1beta1_test package. Problem with this is that in some test files under v1beta1 package, if we want to use some test helper functions that are defined in v1beta1_test package, we cannot import them i.e. getContextBasedOnFeatureFlag, enableAlphaAPIFields.
So it might be great to move those *_test.go files under v1beta1_test package. However, a couple of pain points
- this will change thousand of lines bc we need to import
v1beta1and prefix all functions/structs defined under it. - there are LOTS of unexported functions defined in
v1beta1but used in these*_test.gofiles i.e. examplevalidateParamResults. If we change*_test.gofrom packagev1beta1tov1beta1_test, we are not sure if it's appropriate to export those functions OR just remove testings for those unexported functions.
Talked to @lbernick about this today. Loop in @JeromeJu for visibility.
So this issue is created to track the thoughts/comments/suggestions about this.
The motivation here is based on our code standards for tests, which state that we should aim to only test exported functions. FYI @pritidesai
Note that the main point on the "code standards" is that exported function are tested, the only, for me, is to take with a grain of salt. In an ideal world we would only test exported method ; which tends to make the code base be composed of smaller packages. But we are not in an ideal world π .
Also, if there is, sometimes, cases where we would like to exported a function or a set of function but we are not really prepared to support go package users to use those, there is always the possibility to use the special internal package πΌπΌ
/assign
The test files in v1 would be moved to v1_test in a separated PR from https://github.com/tektoncd/pipeline/pull/5219.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle rotten
Send feedback to tektoncd/plumbing.
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen with a justification.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/close
Send feedback to tektoncd/plumbing.
@tekton-robot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity. Reopen the issue with
/reopenwith a justification. Mark the issue as fresh with/remove-lifecycle rottenwith a justification. If this issue should be exempted, mark the issue as frozen with/lifecycle frozenwith a justification./close
Send feedback to tektoncd/plumbing.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
verified that this could be closed.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle rotten
Send feedback to tektoncd/plumbing.