Skip to content

Commit

Permalink
Fix failing deployment hook fixture
Browse files Browse the repository at this point in the history
Use a more stable and predictable command to exercise failing pre-hooks
with retries. The former command assumed specific Docker 1.10 behavior
whereby missing commands produced error messages in the container output
stream, an assumption which no longer holds true in Docker 1.12.

The fixture and test assertions should now be portable across Docker
versions.

Fixes openshift#11630
  • Loading branch information
ironcladlou committed Oct 27, 2016
1 parent 0403599 commit 36ef464
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/extended/deployments/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ var _ = g.Describe("deploymentconfigs", func() {

g.By(fmt.Sprintf("checking the logs for substrings\n%s", out))
o.Expect(out).To(o.ContainSubstring("--> pre: Running hook pod ..."))
o.Expect(out).To(o.ContainSubstring("no such file or directory"))
o.Expect(out).To(o.ContainSubstring("pre hook logs"))
o.Expect(out).To(o.ContainSubstring("--> pre: Retrying hook pod (retry #1)"))
})
})
Expand Down
4 changes: 3 additions & 1 deletion test/extended/testdata/deployments/failing-pre-hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ spec:
execNewPod:
containerName: myapp
command:
- /bin/echo `date`; /bin/true
- /bin/bash
- -c
- '/bin/echo pre hook logs ; exit 1'
template:
metadata:
labels:
Expand Down

0 comments on commit 36ef464

Please sign in to comment.