Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put all pkg/apis/pipeline/v1beta1/*_test.go files to v1beta1_test package #5111

Open
chuangw6 opened this issue Jul 8, 2022 · 11 comments
Open
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@chuangw6
Copy link
Member

chuangw6 commented Jul 8, 2022

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 v1beta1 and prefix all functions/structs defined under it.
  • there are LOTS of unexported functions defined in v1beta1 but used in these *_test.go files i.e. example validateParamResults. If we change *_test.go from package v1beta1 to v1beta1_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.

@chuangw6 chuangw6 added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 8, 2022
@lbernick lbernick added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed kind/feature Categorizes issue or PR as related to a new feature. labels Jul 8, 2022
@lbernick
Copy link
Member

lbernick commented Jul 8, 2022

The motivation here is based on our code standards for tests, which state that we should aim to only test exported functions. FYI @pritidesai

@vdemeester
Copy link
Member

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 👼🏼

@JeromeJu
Copy link
Member

JeromeJu commented Aug 2, 2022

/assign

@JeromeJu
Copy link
Member

JeromeJu commented Aug 2, 2022

The test files in v1 would be moved to v1_test in a separated PR from #5219.

@tekton-robot
Copy link
Collaborator

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.

@tekton-robot tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 31, 2022
@tekton-robot
Copy link
Collaborator

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.

@tekton-robot tekton-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 30, 2022
@tekton-robot
Copy link
Collaborator

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
Copy link
Collaborator

@tekton-robot: Closing this issue.

In response to this:

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.

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.

@lbernick lbernick reopened this Apr 3, 2023
@lbernick lbernick removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Apr 3, 2023
@JeromeJu
Copy link
Member

verified that this could be closed.

@tekton-robot
Copy link
Collaborator

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.

@tekton-robot tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 17, 2023
@tekton-robot
Copy link
Collaborator

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.

@tekton-robot tekton-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 17, 2023
@JeromeJu JeromeJu removed their assignment Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
Status: In Progress
Development

No branches or pull requests

5 participants