Merge pull request #1357 from turtlemonvh/1350-extends_parent_build_directory_dne_error
Fix for #1350, nonexisting build path in parent section causes extending section to fail
This commit is contained in:
commit
a631c1eddb
4 changed files with 41 additions and 6 deletions
6
tests/fixtures/extends/nonexistent-path-base.yml
vendored
Normal file
6
tests/fixtures/extends/nonexistent-path-base.yml
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
dnebase:
|
||||
build: nonexistent.path
|
||||
command: /bin/true
|
||||
environment:
|
||||
- FOO=1
|
||||
- BAR=1
|
||||
8
tests/fixtures/extends/nonexistent-path-child.yml
vendored
Normal file
8
tests/fixtures/extends/nonexistent-path-child.yml
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
dnechild:
|
||||
extends:
|
||||
file: nonexistent-path-base.yml
|
||||
service: dnebase
|
||||
image: busybox
|
||||
command: /bin/true
|
||||
environment:
|
||||
- BAR=2
|
||||
|
|
@ -398,6 +398,21 @@ class ExtendsTest(unittest.TestCase):
|
|||
|
||||
self.assertEqual(set(dicts[0]['volumes']), set(paths))
|
||||
|
||||
def test_parent_build_path_dne(self):
|
||||
child = config.load('tests/fixtures/extends/nonexistent-path-child.yml')
|
||||
|
||||
self.assertEqual(child, [
|
||||
{
|
||||
'name': 'dnechild',
|
||||
'image': 'busybox',
|
||||
'command': '/bin/true',
|
||||
'environment': {
|
||||
"FOO": "1",
|
||||
"BAR": "2",
|
||||
},
|
||||
},
|
||||
])
|
||||
|
||||
|
||||
class BuildPathTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
|
@ -407,7 +422,10 @@ class BuildPathTest(unittest.TestCase):
|
|||
options = {'build': 'nonexistent.path'}
|
||||
self.assertRaises(
|
||||
config.ConfigurationError,
|
||||
lambda: config.make_service_dict('foo', options, 'tests/fixtures/build-path'),
|
||||
lambda: config.from_dictionary({
|
||||
'foo': options,
|
||||
'working_dir': 'tests/fixtures/build-path'
|
||||
})
|
||||
)
|
||||
|
||||
def test_relative_path(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue