-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Enforce test style on e2e_node and e2e_kubeadm tests #78779
Conversation
Hi @odinuge. Thanks for your PR. I'm waiting for a kubernetes 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. |
/assign @oomichi |
@odinuge big thanks for doing this :-) /ok-to-test |
This is necessary to be updated for passing pull-kubernetes-bazel-build job by fixing the following failures:
|
Thanks for updating, /lgtm |
/approve |
Remove the use of Except(err).NotTo(HaveOccured()), and switch to using framework ramework.ExpectNoError(err)
/retest Had to fix some conflicting files @oomichi 😄 |
@odinuge OK, I will check this again after passing all test jobs. |
/test pull-kubernetes-integration |
1 similar comment
/test pull-kubernetes-integration |
/test pull-kubernetes-bazel-test |
/lgtm |
/assign @vishh |
@@ -21,7 +21,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. | |||
cd "${KUBE_ROOT}" | |||
|
|||
# NOTE: This checks e2e test code without the e2e framework which contains Expect().To(HaveOccurred()) | |||
mapfile -t all_e2e_files < <(find test/e2e -name '*.go' | grep -v 'test/e2e/framework/') | |||
mapfile -t all_e2e_files < <(find test/e2e{,_node,_kubeadm} -name '*.go' | grep -v 'test/e2e/framework/') |
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.
NOTE: see previous discussions in this repo: we don't use mapfile because it doesn't exist on macOS. there are examples of alternatives eleswhere in hack/ such as the verify-shellcheck script (read loop)
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.
this particular change looks fine, but the original implementation probably should not have introduced mapfile usage
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.
@BenTheElder I see, thanks for your comment. I will follow the mapfile issue with another PR with some digging.
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.
There is a tool inside hack/lib/util.sh
called kube::util::read-array
that works the same way as mapfile -t
, and works in bash3 😄 @oomichi @BenTheElder But yeah, that can be fixed in another PR.
Line 715 in b3a73f7
function kube::util::read-array { |
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.
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.
#79186 is the follow-up PR.
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
we should follow up on the one comment, but it wasn't introduced in this PR..
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BenTheElder, odinuge, 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 |
During the review of kubernetes#78779 we've known mapfile doesn't work on macOS. So we need to use alternative way instead and this is it.
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This enforces the policy no more "Expect(err).NotTo(HaveOccurred())" on the e2e_node and e2e_kubeadm folders. Previously it was just enforced on the e2e-tests.
Which issue(s) this PR fixes:
Fixes #34059 (enforced by the script), there are still ~1500
framework.ExpectNoError(err)
s without an assertion message tho.Fixes #77103
/priority backlog
Special notes for your reviewer:
Does this PR introduce a user-facing change?: