Change:
What happened: After fixing golint failures under (now still in progress), we need to put for each and . Then common error checking code has become like: We can replace this code with which is more readable and easy to be understood what the code does. Now we have following e2e test directories which can be replaced: [x] test/e2e/apimachinery/ () [x] test/e2e/apps/ () [x] test/e2e/auth/ () [x] test/e2e/common/ () [x] test/e2e/node/ () [x] test/e2e/storage/ () [x] () [x] () [x] () [x] () [x] () [x] () [x] [x] test/e2e/storage/persistentvolumes- [x] () [x] () [x] [x] [x] [x] [x] ()
/sig testing /kind cleanup
/assign PR will be submitted soon.
Fix the following in
Fix in
Fix in
Hi, maybe I could take files beneath test/e2e/storage/vsphere/
oops, I'm finished and prepare for PR.
Thank you That's OK
Fix the following in
/assign
All related PRs were merged. I think this ticket can be closed. BTW, should we also replace to ?
Thanks for your work. thing is managed with We are almost finishing the work also :-)
/remove-kind bug
I found in these files. I'm working on :
I can work to the following item.

Discussion:
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. cd "${KUBE_ROOT}" <del> mapfile -t all_e2e_files < <(find test/e2e -name '*.go') </del> <ins> # 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/') </ins> errors_expect_no_error=() for file in "${all_e2e_files[@]}" do

fi done <ins> errors_expect_error=() for file in "${all_e2e_files[@]}" do if grep "Expect(.*).To(.*HaveOccurred()" "${file}" > /dev/null then errors_expect_error+=( "${file}" ) fi done </ins> if [ ${#errors_expect_no_error[@]} -ne 0 ]; then { echo "Errors:"

exit 1 fi <ins> if [ ${#errors_expect_error[@]} -ne 0 ]; then { echo "Errors:" for err in "${errors_expect_error[@]}"; do echo "$err" done echo echo 'The above files need to use framework.ExpectError(err) instead of ' echo 'Expect(err).To(HaveOccurred()) or gomega.Expect(err).To(gomega.HaveOccurred())' echo } >&2 exit 1 fi </ins> echo 'Congratulations!  All e2e test source files are valid.'

gomega.Expect(stdout).To(gomega.Equal(mountName), msg) } else { // We *expect* cat to return error here <del> gomega.Expect(err).To(gomega.HaveOccurred(), msg) </del> <ins> framework.ExpectError(err, msg) </ins> } } }

} } if test.disableAttach { <del> gomega.Expect(err).To(gomega.HaveOccurred(), "Unexpected VolumeAttachment found") </del> <ins> framework.ExpectError(err, "Unexpected VolumeAttachment found") </ins> } })

} if test.expectFailure { err = waitForResizingCondition(pvc, m.cs, csiResizingConditionWait) <del> gomega.Expect(err).To(gomega.HaveOccurred(), "unexpected resizing condition on PVC") </del> <ins> framework.ExpectError(err, "unexpected resizing condition on PVC") </ins> return }

bashExec, exitCode, err) } } <del> gomega.Expect(err).To(gomega.HaveOccurred(), "%q should fail with exit code %d, but exit without error", bashExec, exitCode) </del> <ins> framework.ExpectError(err, "%q should fail with exit code %d, but exit without error", bashExec, exitCode) </ins> } // KubeletCommand performs `start`, `restart`, or `stop` on the kubelet running on the node of the target pod and waits

ginkgo.By("Expanding non-expandable pvc") newSize := resource.MustParse("6Gi") pvc, err = expandPVCSize(pvc, newSize, c) <del> gomega.Expect(err).To(gomega.HaveOccurred(), "While updating non-expandable PVC") </del> <ins> framework.ExpectError(err, "While updating non-expandable PVC") </ins> }) ginkgo.It("Verify if editing PVC allows resize", func() {