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

Enforce test style on e2e_node and e2e_kubeadm tests #78779

Merged
merged 2 commits into from
Jun 19, 2019

Conversation

odinuge
Copy link
Member

@odinuge odinuge commented Jun 6, 2019

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug

/kind cleanup

/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

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?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jun 6, 2019
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jun 6, 2019
@odinuge
Copy link
Member Author

odinuge commented Jun 6, 2019

/assign @oomichi

@oomichi
Copy link
Member

oomichi commented Jun 6, 2019

@odinuge big thanks for doing this :-)

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 6, 2019
@oomichi
Copy link
Member

oomichi commented Jun 8, 2019

This is necessary to be updated for passing pull-kubernetes-bazel-build job by fixing the following failures:

/b/f/w/test/e2e_node/benchmark_util.go:36:2: imported and not used: "k8s.io/kubernetes/vendor/github.com/onsi/gomega"
/b/f/w/test/e2e_node/pods_container_manager_test.go:31:2: imported and not used: "k8s.io/kubernetes/vendor/github.com/onsi/gomega"
/b/f/w/test/e2e_node/resource_usage_test.go:33:2: imported and not used: "k8s.io/kubernetes/vendor/github.com/onsi/gomega"
/b/f/w/test/e2e_node/runtime_conformance_test.go:34:2: imported and not used: "k8s.io/kubernetes/vendor/github.com/onsi/gomega"
/b/f/w/test/e2e_node/volume_manager_test.go:30:2: imported and not used: "k8s.io/kubernetes/vendor/github.com/onsi/gomega"

@oomichi
Copy link
Member

oomichi commented Jun 10, 2019

Thanks for updating,

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 10, 2019
@oomichi
Copy link
Member

oomichi commented Jun 11, 2019

/approve

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 14, 2019
Remove the use of  Except(err).NotTo(HaveOccured()), and switch to using
framework ramework.ExpectNoError(err)
@odinuge
Copy link
Member Author

odinuge commented Jun 14, 2019

/retest

Had to fix some conflicting files @oomichi 😄

@oomichi
Copy link
Member

oomichi commented Jun 14, 2019

@odinuge OK, I will check this again after passing all test jobs.
Thanks for updating :-)

@oomichi
Copy link
Member

oomichi commented Jun 14, 2019

/test pull-kubernetes-integration

1 similar comment
@odinuge
Copy link
Member Author

odinuge commented Jun 14, 2019

/test pull-kubernetes-integration

@oomichi
Copy link
Member

oomichi commented Jun 14, 2019

/test pull-kubernetes-bazel-test

@oomichi
Copy link
Member

oomichi commented Jun 14, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 14, 2019
@odinuge
Copy link
Member Author

odinuge commented Jun 18, 2019

/assign @vishh

@k8s-ci-robot k8s-ci-robot added priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jun 18, 2019
@@ -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/')
Copy link
Member

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)

Copy link
Member

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

Copy link
Member

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.

Copy link
Member Author

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.

function kube::util::read-array {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oomichi @odinuge thanks! that's exactly the thing to do, let's do that in another PR. feel free to ping me on that one for approval 😅

Copy link
Member

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.

Copy link
Member

@BenTheElder BenTheElder left a 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..

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 19, 2019
@k8s-ci-robot k8s-ci-robot merged commit c2ff62c into kubernetes:master Jun 19, 2019
oomichi pushed a commit to oomichi/kubernetes that referenced this pull request Jun 20, 2019
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note-none Denotes a PR that doesn't merit a release note. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
5 participants