Commit aca984cb authored by Corentin Wallez's avatar Corentin Wallez Committed by Commit Bot

Add test for a weirdness of gclient use_relative_paths and recurse_deps

BUG=

Change-Id: I1f8be18b821d45564bbabbd4e90eb2624d51a3f9
Reviewed-on: https://chromium-review.googlesource.com/1213582Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent a0ae138a
......@@ -796,7 +796,7 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
])
def findDepsFromNotAllowedHosts(self):
"""Returns a list of depenecies from not allowed hosts.
"""Returns a list of dependencies from not allowed hosts.
If allowed_hosts is not set, allows all hosts and returns empty list.
"""
......
......@@ -772,6 +772,45 @@ class GclientTest(trial_dir.TestCase):
],
self._get_processed())
def testRelativeRecursionInNestedDir(self):
"""Verifies a gotcha of relative recursion where the parent uses relative
paths but not the dependency being recursed in. In that case the recursed
dependencies will only take into account the first directory of its path.
In this test it can be seen in baz being placed in foo/third_party."""
write(
'.gclient',
'solutions = [\n'
' { "name": "foo", "url": "svn://example.com/foo" },\n'
']')
write(
os.path.join('foo', 'DEPS'),
'use_relative_paths = True\n'
'deps = {\n'
' "third_party/bar": "/bar",\n'
'}\n'
'recursedeps = ["third_party/bar"]')
write(
os.path.join('foo/third_party/bar', 'DEPS'),
'deps = {\n'
' "baz": "/baz",\n'
'}')
write(
os.path.join('baz', 'DEPS'),
'deps = {\n'
' "fizz": "/fizz",\n'
'}')
options, _ = gclient.OptionParser().parse_args([])
obj = gclient.GClient.LoadCurrentConfig(options)
obj.RunOnDeps('None', [])
self.assertEquals(
[
('foo', 'svn://example.com/foo'),
('foo/third_party/bar', 'svn://example.com/bar'),
('foo/third_party/baz', 'svn://example.com/baz'),
],
self._get_processed())
def testRecursedepsAltfile(self):
"""Verifies gclient respects the |recursedeps| var syntax with overridden
target DEPS file.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment