Skip to content

Commit 358536e

Browse files
authored
Merge pull request kubernetes#77693 from oomichi/use-ExpectNoError-root
Use framework.ExpectNoError() for e2e/
2 parents b066e0d + 2a7202b commit 358536e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

test/e2e/examples.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import (
3535
"k8s.io/kubernetes/test/e2e/framework/testfiles"
3636

3737
. "github.com/onsi/ginkgo"
38-
. "github.com/onsi/gomega"
3938
)
4039

4140
const (
@@ -78,7 +77,7 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
7877
passed := true
7978
checkRestart := func(podName string, timeout time.Duration) {
8079
err := framework.WaitForPodNameRunningInNamespace(c, podName, ns)
81-
Expect(err).NotTo(HaveOccurred())
80+
framework.ExpectNoError(err)
8281
for t := time.Now(); time.Since(t) < timeout; time.Sleep(framework.Poll) {
8382
pod, err := c.CoreV1().Pods(ns).Get(podName, metav1.GetOptions{})
8483
framework.ExpectNoError(err, fmt.Sprintf("getting pod %s", podName))
@@ -124,11 +123,11 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
124123
framework.RunKubectlOrDieInput(secretYaml, "create", "-f", "-", nsFlag)
125124
framework.RunKubectlOrDieInput(podYaml, "create", "-f", "-", nsFlag)
126125
err := framework.WaitForPodNoLongerRunningInNamespace(c, podName, ns)
127-
Expect(err).NotTo(HaveOccurred())
126+
framework.ExpectNoError(err)
128127

129128
By("checking if secret was read correctly")
130129
_, err = framework.LookForStringInLog(ns, "secret-test-pod", "test-container", "value-1", serverStartTimeout)
131-
Expect(err).NotTo(HaveOccurred())
130+
framework.ExpectNoError(err)
132131
})
133132
})
134133

@@ -142,13 +141,13 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
142141
By("creating the pod")
143142
framework.RunKubectlOrDieInput(podYaml, "create", "-f", "-", nsFlag)
144143
err := framework.WaitForPodNoLongerRunningInNamespace(c, podName, ns)
145-
Expect(err).NotTo(HaveOccurred())
144+
framework.ExpectNoError(err)
146145

147146
By("checking if name and namespace were passed correctly")
148147
_, err = framework.LookForStringInLog(ns, podName, "test-container", fmt.Sprintf("MY_POD_NAMESPACE=%v", ns), serverStartTimeout)
149-
Expect(err).NotTo(HaveOccurred())
148+
framework.ExpectNoError(err)
150149
_, err = framework.LookForStringInLog(ns, podName, "test-container", fmt.Sprintf("MY_POD_NAME=%v", podName), serverStartTimeout)
151-
Expect(err).NotTo(HaveOccurred())
150+
framework.ExpectNoError(err)
152151
})
153152
})
154153
})

0 commit comments

Comments
 (0)