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

Error checks from waitForEndoint in e2e examples tests #15152

Merged
merged 1 commit into from Oct 6, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 16 additions & 8 deletions test/e2e/examples.go
Expand Up @@ -148,7 +148,8 @@ var _ = Describe("Examples e2e", func() {
_, err := lookForStringInLog(ns, pod.Name, "rabbitmq", "Server startup complete", serverStartTimeout)
Expect(err).NotTo(HaveOccurred())
})
waitForEndpoint(c, ns, "rabbitmq-service")
err := waitForEndpoint(c, ns, "rabbitmq-service")
Copy link
Member

Choose a reason for hiding this comment

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

how about expectNoError(waitForEndpoint(c, ns, "rabbitmq-service"))?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this file cluster control is not mixed with assertions (in a single line).

Expect(err).NotTo(HaveOccurred())

By("starting celery")
runKubectl("create", "-f", celeryControllerYaml, nsFlag)
Expand Down Expand Up @@ -194,7 +195,8 @@ var _ = Describe("Examples e2e", func() {
Expect(err).NotTo(HaveOccurred())

By("waiting for master endpoint")
waitForEndpoint(c, ns, "spark-master")
err = waitForEndpoint(c, ns, "spark-master")
Expect(err).NotTo(HaveOccurred())

By("starting workers")
runKubectl("create", "-f", workerControllerJson, nsFlag)
Expand Down Expand Up @@ -225,7 +227,8 @@ var _ = Describe("Examples e2e", func() {
_, err = lookForStringInLog(ns, "cassandra", "cassandra", "Listening for thrift clients", serverStartTimeout)
Expect(err).NotTo(HaveOccurred())

waitForEndpoint(c, ns, "cassandra")
err = waitForEndpoint(c, ns, "cassandra")
Expect(err).NotTo(HaveOccurred())

By("create and scale rc")
runKubectl("create", "-f", controllerYaml, nsFlag)
Expand Down Expand Up @@ -269,14 +272,17 @@ var _ = Describe("Examples e2e", func() {
By("checking if zookeeper is up and running")
_, err = lookForStringInLog(ns, zookeeperPod, "zookeeper", "binding to port", serverStartTimeout)
Expect(err).NotTo(HaveOccurred())
waitForEndpoint(c, ns, "zookeeper")
err = waitForEndpoint(c, ns, "zookeeper")
Expect(err).NotTo(HaveOccurred())

By("starting Nimbus")
runKubectl("create", "-f", nimbusPodJson, nsFlag)
runKubectl("create", "-f", nimbusServiceJson, nsFlag)
err = waitForPodRunningInNamespace(c, "nimbus", ns)
Expect(err).NotTo(HaveOccurred())
waitForEndpoint(c, ns, "nimbus")

err = waitForEndpoint(c, ns, "nimbus")
Expect(err).NotTo(HaveOccurred())

By("starting workers")
runKubectl("create", "-f", workerControllerJson, nsFlag)
Expand Down Expand Up @@ -390,7 +396,8 @@ var _ = Describe("Examples e2e", func() {
})
}
checkDbInstances()
waitForEndpoint(c, ns, "rethinkdb-driver")
err := waitForEndpoint(c, ns, "rethinkdb-driver")
Expect(err).NotTo(HaveOccurred())

By("scaling rethinkdb")
ScaleRC(c, ns, "rethinkdb-rc", 2, true)
Expand All @@ -399,7 +406,7 @@ var _ = Describe("Examples e2e", func() {
By("starting admin")
runKubectl("create", "-f", adminServiceYaml, nsFlag)
runKubectl("create", "-f", adminPodYaml, nsFlag)
err := waitForPodRunningInNamespace(c, "rethinkdb-admin", ns)
err = waitForPodRunningInNamespace(c, "rethinkdb-admin", ns)
Expect(err).NotTo(HaveOccurred())
checkDbInstances()
content, err := makeHttpRequestToService(c, ns, "rethinkdb-admin", "/", endpointRegisterTimeout)
Expand Down Expand Up @@ -429,7 +436,8 @@ var _ = Describe("Examples e2e", func() {
Expect(err).NotTo(HaveOccurred())
})

waitForEndpoint(c, ns, "hazelcast")
err := waitForEndpoint(c, ns, "hazelcast")
Expect(err).NotTo(HaveOccurred())

By("scaling hazelcast")
ScaleRC(c, ns, "hazelcast", 2, true)
Expand Down