Skip to content

Commit 2e97e4a

Browse files
committed
adding docker checks and proper handling
1 parent 2bca8bc commit 2e97e4a

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

src/staticfile/integration/default_test.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,18 @@ func testDefault(platform switchblade.Platform, fixtures string) func(*testing.T
9090

9191
Expect(contents).To(ContainSubstring("404 Not Found"), string(contents))
9292

93-
cmd := exec.Command("docker", "container", "logs", deployment.Name)
94-
95-
output, err := cmd.CombinedOutput()
96-
Expect(err).NotTo(HaveOccurred())
97-
98-
Expect(string(output)).To(ContainSubstring("GET / HTTP/1.1"))
99-
Expect(string(output)).To(ContainSubstring("GET /does-not-exist HTTP/1.1"))
100-
101-
//how to handle this in CF?
102-
cmd = exec.Command("docker", "container", "exec", deployment.Name, "stat", "app/nginx/logs/access.log", "app/nginx/logs/error.log")
103-
Expect(cmd.Run()).To(Succeed())
93+
Eventually(func() string {
94+
logs, _ := deployment.RuntimeLogs()
95+
return logs.(string)
96+
}, "10s", "1s").Should(Or(
97+
ContainSubstring("GET / HTTP/1.1"),
98+
ContainSubstring("GET /does-not-exist HTTP/1.1"),
99+
))
100+
101+
if settings.Platform == "docker" {
102+
cmd := exec.Command("docker", "container", "exec", deployment.Name, "stat", "app/nginx/logs/access.log", "app/nginx/logs/error.log")
103+
Expect(cmd.Run()).To(Succeed())
104+
}
104105
})
105106
})
106107

0 commit comments

Comments
 (0)