@@ -30,20 +30,19 @@ func TestCascadeStop(t *testing.T) {
30
30
const projectName = "compose-e2e-logs"
31
31
32
32
t .Run ("abort-on-container-exit" , func (t * testing.T ) {
33
- res := c .RunDockerCmd ("compose" , "-f" , "./fixtures/cascade-stop-test/compose.yaml" , "--project-name" , projectName , "up" , "--abort-on-container-exit" )
34
- res .Assert (t , icmd.Expected {Out : `/does_not_exist: No such file or directory` })
35
- res .Assert (t , icmd.Expected {Out : `should_fail_1 exited with code 1` })
36
- res .Assert (t , icmd.Expected {Out : `Aborting on container exit...` })
37
- res .Assert (t , icmd.Expected {Out : `ERROR 1` })
38
- res .Assert (t , icmd.Expected {ExitCode : 1 })
33
+ res := c .RunDockerOrExitError ("compose" , "-f" , "./fixtures/cascade-stop-test/compose.yaml" , "--project-name" , projectName , "up" , "--abort-on-container-exit" )
34
+ res .Assert (t , icmd.Expected {ExitCode : 1 , Out : `should_fail_1 exited with code 1` })
35
+ res .Assert (t , icmd.Expected {ExitCode : 1 , Out : `Aborting on container exit...` })
39
36
})
40
37
41
38
t .Run ("exit-code-from" , func (t * testing.T ) {
42
- res := c .RunDockerCmd ("compose" , "-f" , "./fixtures/cascade-stop-test/compose.yaml" , "--project-name" , projectName , "up" , "--exit-code-from=sleep" )
43
- res .Assert (t , icmd.Expected {Out : `/does_not_exist: No such file or directory` })
44
- res .Assert (t , icmd.Expected {Out : `should_fail_1 exited with code 1` })
45
- res .Assert (t , icmd.Expected {Out : `Aborting on container exit...` })
46
- res .Assert (t , icmd.Expected {Out : `ERROR 143` })
47
- res .Assert (t , icmd.Expected {ExitCode : 143 })
39
+ res := c .RunDockerOrExitError ("compose" , "-f" , "./fixtures/cascade-stop-test/compose.yaml" , "--project-name" , projectName , "up" , "--exit-code-from=sleep" )
40
+ res .Assert (t , icmd.Expected {ExitCode : 137 , Out : `should_fail_1 exited with code 1` })
41
+ res .Assert (t , icmd.Expected {ExitCode : 137 , Out : `Aborting on container exit...` })
42
+ })
43
+
44
+ t .Run ("exit-code-from unknown" , func (t * testing.T ) {
45
+ res := c .RunDockerOrExitError ("compose" , "-f" , "./fixtures/cascade-stop-test/compose.yaml" , "--project-name" , projectName , "up" , "--exit-code-from=unknown" )
46
+ res .Assert (t , icmd.Expected {ExitCode : 1 , Err : `no such service: unknown` })
48
47
})
49
48
}
0 commit comments