Use framework.ExpectNoError() instead Expect()

The e2e test framework has ExpectNoError() for readable test code.
This replaces Expect(err).NotTo(HaveOccurred()) with it.
This commit is contained in:
Kenichi Omichi
2019-02-15 04:10:36 +00:00
parent 596406581e
commit 2635b6d95c
14 changed files with 58 additions and 70 deletions

View File

@@ -45,7 +45,6 @@ import (
imageutils "k8s.io/kubernetes/test/utils/image"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
const (
@@ -349,7 +348,7 @@ func GetNodePublicIps(c clientset.Interface) ([]string, error) {
func PickNodeIP(c clientset.Interface) string {
publicIps, err := GetNodePublicIps(c)
Expect(err).NotTo(HaveOccurred())
ExpectNoError(err)
if len(publicIps) == 0 {
Failf("got unexpected number (%d) of public IPs", len(publicIps))
}