-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
chore: modify test package name #6472
chore: modify test package name #6472
Conversation
Hi @l-qing. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/kind misc |
The following is the coverage report on the affected files.
|
/retest |
@l-qing: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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. |
b7c5416
to
631991e
Compare
The following is the coverage report on the affected files.
|
631991e
to
230e5dd
Compare
The following is the coverage report on the affected files.
|
230e5dd
to
3d8892b
Compare
The following is the coverage report on the affected files.
|
/assign @lbernick |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @l-qing!
Looks like dot import is generally not recommended but useful golang tests. But anyways, the foo_test
package can be used as a reference for people submitting PR in the future for sure👍 .
Related: #5111
😅 |
/ok-to-test |
The following is the coverage report on the affected files.
|
So the use of dot-import here is to not have to prefix all types with
|
3d8892b
to
0ab31a1
Compare
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one nit (a typo), otherwise LGTM
|
||
import ( | ||
"strings" | ||
"testing" | ||
|
||
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" | ||
prresoruces "github.com/tektoncd/pipeline/pkg/reconciler/pipelinerun/resources" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this looks like a typo ? prresoruces
-> prresources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I have made the adjustments and rebased onto the latest main branch.
8b2a1eb
to
2faf8ee
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/cc @vdemeester @jerop |
2faf8ee
to
3f4ada2
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
3f4ada2
to
34a67df
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/retest |
34a67df
to
7515c37
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
Try to ensure that only exported functions are tested. Ref: https://github.com/tektoncd/community/blob/main/standards.md#go-packages ``` All exported functions should have tests * If your package is named "foo", prefer putting tests in a "foo_test" package in the same folder to ensure that only exported functions are tested ``` The shell command to search for test package names without the `_test` suffix is: * `find . -name "*_test.go" | xargs grep -E '^package ' | grep -Ev '_test$' | grep -v '^./test' | sort`
7515c37
to
3b0f7bd
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
looks like Jerop and Vincent's feedback has been addressed. |
Thank you for your comment. |
Changes
Ref: https://github.com/tektoncd/community/blob/main/standards.md#go-packages
The shell command to search for test package names without the
_test
suffix is:find . -name "*_test.go" | xargs grep -E '^package ' | grep -Ev '_test$' | grep -v '^./test' | sort
I did not finish all the changes this time because some packages do use private methods or variables.
I hope that we can follow the community's conventions as closely as possible, and provide a reference for the people who submit pull requests in the future.
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes