Skip to content

Commit

Permalink
deploy: check the dc conditions instead of relying on deployer logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mfojtik committed May 29, 2017
1 parent fce1a37 commit 8bb6996
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions test/extended/deployments/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,16 @@ var _ = g.Describe("deploymentconfigs", func() {
g.By(fmt.Sprintf("checking the logs for substrings\n%s", out))
o.Expect(out).To(o.ContainSubstring("deployment-test-1 to 2"))
o.Expect(out).To(o.ContainSubstring("--> pre: Success"))
o.Expect(out).To(o.ContainSubstring("--> Success"))
// FIXME: In some cases the last line from the deployer pod log is lost so we
// can't check the '--> Success' message here.
// Instead of relying on the log message, verify the DC condition and check that
// the new RC is available. See: origin#13980
if dc, _, _, err := deploymentInfo(oc, "deployment-test"); err != nil {
o.Expect(err).NotTo(o.HaveOccurred())
} else {
cond := deployutil.GetDeploymentCondition(dc.Status, deployapi.DeploymentProgressing)
o.Expect(cond.Reason).To(o.BeEquivalentTo(deployapi.NewRcAvailableReason))
}

g.By("verifying the deployment is marked complete and scaled to zero")
o.Expect(waitForLatestCondition(oc, "deployment-test", deploymentRunTimeout, deploymentReachedCompletion)).NotTo(o.HaveOccurred())
Expand Down Expand Up @@ -304,7 +313,17 @@ var _ = g.Describe("deploymentconfigs", func() {
o.Expect(out).To(o.ContainSubstring(fmt.Sprintf("deployment-test-%d up to 1", i+2)))
o.Expect(out).To(o.ContainSubstring("--> pre: Success"))
o.Expect(out).To(o.ContainSubstring("test pre hook executed"))
o.Expect(out).To(o.ContainSubstring("--> Success"))

// FIXME: In some cases the last line from the deployer pod log is lost so we
// can't check the '--> Success' message here.
// Instead of relying on the log message, verify the DC condition and check that
// the new RC is available. See: origin#13980
if dc, _, _, err := deploymentInfo(oc, "deployment-test"); err != nil {
o.Expect(err).NotTo(o.HaveOccurred())
} else {
cond := deployutil.GetDeploymentCondition(dc.Status, deployapi.DeploymentProgressing)
o.Expect(cond.Reason).To(o.BeEquivalentTo(deployapi.NewRcAvailableReason))
}
}
})
})
Expand Down

0 comments on commit 8bb6996

Please sign in to comment.