-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cli] run --rm overrides restart: always #1205
Conversation
All tests pass on local, why they failed with Jenkins ? |
Your commit needs signing off:
|
Also, could we get an integration test please? Thanks! |
#1013 Signed-off-by: Joseph Page <joseph.page@rednet.io>
@aanand Because the container is created and immediately removed by What do you think about it ? @patch('dockerpty.start')
def test_run_service_with_restart_always(self, __):
name = 'simple'
self.command.base_dir = 'tests/fixtures/restart-composefile'
self.command.dispatch(['run', name, '/bin/echo', 'helloworld'], None)
service = self.project.get_service(name)
container = service.containers(one_off=True)[0]
self.assertEqual(container.get('HostConfig.RestartPolicy.Name'), 'always')
self.command.dispatch(['run', '--rm', name, '/bin/echo', 'helloworld'], None)
self.assertEqual(len(service.containers()), 0)
self.assertEqual(len(service.containers(stopped=True)), 0) with this simple:
image: busybox:latest
restart: always |
Hm, good point. In that case, maybe just a unit test - use |
Signed-off-by: Joseph Page <joseph.page@rednet.io>
Just added a unit test. Seems good to you @aanand ? |
@aanand some updates here? we would need this fix merged. If I can be of some help just ping me. |
LGTM |
OK, looks like the CLI code is too tightly coupled to improve that unit test without a lot of refactoring. LGTM |
[cli] run --rm overrides restart: always
Fix #1013
I think docs is not needed because it's an intuitive behavior.