-
Notifications
You must be signed in to change notification settings - Fork 39.4k
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
Add code check for framework.ExpectEqual() #80785
Conversation
@oomichi: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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. |
/release-note-none |
hack/verify-test-code.sh
Outdated
errors_expect_equal=() | ||
for file in "${all_e2e_files[@]}" | ||
do | ||
if grep "Expect(.*)\.To(.*Equal(" "${file}" > /dev/null |
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.
The line detects test/e2e/auth/node_authn.go as containing errors.
node_authn.go contains the following line. But I think that it should not be detected.
gomega.Expect(result).To(gomega.Or(gomega.Equal("401"), gomega.Equal("403")), ...
How about changing it like grep -E "Expect\(.*\)\.To\((gomega\.Equal|Equal)
?
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.
@k-toyoda-pi Thank you for your comment, nice catch.
I will update this soon.
This adds code check for using framework.ExpectEqual(foo, bar) in e2e tests for keeping the test code simple.
a173e37
to
ad98808
Compare
/sig testing |
/priority important-soon |
/area test |
To wait for merging necessary PRs before this. /hold |
All necessary PRs are merged, so let's retest this. /retest |
@spiffxp This seems ready at this time, PTAL :-) |
/cc @BenTheElder Could you take a look at this? |
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BenTheElder, oomichi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Review the full test history for this PR. Silence the bot with an |
2 similar comments
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/test pull-kubernetes-kubemark-e2e-gce-big |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This adds code check for using framework.ExpectEqual(foo, bar) in
e2e tests for keeping the test code simple.
Close: #79686
Special notes for your reviewer:
When we finish all tasks in #79686 this PR can be merged.