stop.feature 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. Feature: Stop
  2. Background:
  3. Given a compose file
  4. """
  5. services:
  6. should_fail:
  7. image: alpine
  8. command: ['sh', '-c', 'exit 123']
  9. sleep: # will be killed
  10. image: alpine
  11. command: ping localhost
  12. init: true
  13. """
  14. Scenario: Cascade stop
  15. When I run "compose up --abort-on-container-exit"
  16. Then the output contains "should_fail-1 exited with code 123"
  17. And the output contains "Aborting on container exit..."
  18. And the exit code is 123
  19. Scenario: Exit code from
  20. When I run "compose up --exit-code-from should_fail"
  21. Then the output contains "should_fail-1 exited with code 123"
  22. And the output contains "Aborting on container exit..."
  23. And the exit code is 123
  24. # TODO: this is currently not working propagating the exit code properly
  25. #Scenario: Exit code from (cascade stop)
  26. # When I run "compose up --exit-code-from sleep"
  27. # Then the output contains "should_fail-1 exited with code 123"
  28. # And the output contains "Aborting on container exit..."
  29. # And the exit code is 143
  30. Scenario: Exit code from unknown service
  31. When I run "compose up --exit-code-from unknown"
  32. Then the output contains "no such service: unknown"
  33. And the exit code is 1