@@ -36,7 +36,7 @@ func testDefault(platform switchblade.Platform, fixtures string) func(*testing.T
3636 t .Logf ("❌ FAILED TEST - App/Container: %s" , name )
3737 t .Logf (" Platform: %s" , settings .Platform )
3838 }
39- if name != "" && (! settings .KeepFailedContainers || ! t .Failed ()) {
39+ if name != "" && ! t . Skipped () && (! settings .KeepFailedContainers || ! t .Failed ()) {
4040 Expect (platform .Delete .Execute (name )).To (Succeed ())
4141 }
4242 })
@@ -90,16 +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- cmd = exec .Command ("docker" , "container" , "exec" , deployment .Name , "stat" , "app/nginx/logs/access.log" , "app/nginx/logs/error.log" )
102- Expect (cmd .Run ()).To (Succeed ())
93+ Eventually (func () string {
94+ logs , _ := deployment .RuntimeLogs ()
95+ return logs
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+ }
103105 })
104106 })
105107
0 commit comments