Expand depends_on to allow different conditions (service_start, service_healthy)
Rework "up" and "start" to wait on conditional state of dependent services Add integration tests Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
f6edd610f3
commit
04394b1d0a
10 changed files with 228 additions and 18 deletions
|
|
@ -920,7 +920,10 @@ class ConfigTest(unittest.TestCase):
|
|||
'build': {'context': os.path.abspath('/')},
|
||||
'image': 'example/web',
|
||||
'volumes': [VolumeSpec.parse('/home/user/project:/code')],
|
||||
'depends_on': ['db', 'other'],
|
||||
'depends_on': {
|
||||
'db': {'condition': 'container_start'},
|
||||
'other': {'condition': 'container_start'},
|
||||
},
|
||||
},
|
||||
{
|
||||
'name': 'db',
|
||||
|
|
@ -3055,7 +3058,9 @@ class ExtendsTest(unittest.TestCase):
|
|||
image: example
|
||||
""")
|
||||
services = load_from_filename(str(tmpdir.join('docker-compose.yml')))
|
||||
assert service_sort(services)[2]['depends_on'] == ['other']
|
||||
assert service_sort(services)[2]['depends_on'] == {
|
||||
'other': {'condition': 'container_start'}
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.xfail(IS_WINDOWS_PLATFORM, reason='paths use slash')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue