Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Unified Diff: tests/gclient_test.py

Issue 2324513003: Propagate use_relative_paths into recursedeps (Closed)
Patch Set: Add/fix test for recursion Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gclient.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/gclient_test.py
diff --git a/tests/gclient_test.py b/tests/gclient_test.py
index 769cc7522197f9cea7eb34e87339054e791974b0..0f280236494dce17a1a25738655c93ed5d9b27a8 100755
--- a/tests/gclient_test.py
+++ b/tests/gclient_test.py
@@ -220,7 +220,7 @@ class GclientTest(trial_dir.TestCase):
# auto-fixed.
d = gclient.Dependency(
None, 'name', 'proto://host/path/@revision', None, None, None, None,
- None, '', True)
+ None, '', True, False)
self.assertEquals('proto://host/path@revision', d.url)
def testStr(self):
@@ -228,28 +228,28 @@ class GclientTest(trial_dir.TestCase):
options, _ = parser.parse_args([])
obj = gclient.GClient('foo', options)
obj.add_dependencies_and_close(
- [
- gclient.Dependency(
- obj, 'foo', 'url', None, None, None, None, None, 'DEPS', True),
- gclient.Dependency(
- obj, 'bar', 'url', None, None, None, None, None, 'DEPS', True),
- ],
- [])
+ [
+ gclient.Dependency(
+ obj, 'foo', 'url', None, None, None, None, None, 'DEPS', True, False),
+ gclient.Dependency(
+ obj, 'bar', 'url', None, None, None, None, None, 'DEPS', True, False),
+ ],
+ [])
obj.dependencies[0].add_dependencies_and_close(
- [
- gclient.Dependency(
- obj.dependencies[0], 'foo/dir1', 'url', None, None, None, None,
- None, 'DEPS', True),
- gclient.Dependency(
- obj.dependencies[0], 'foo/dir2',
- gclient.GClientKeywords.FromImpl('bar'), None, None, None, None,
- None, 'DEPS', True),
- gclient.Dependency(
- obj.dependencies[0], 'foo/dir3',
- gclient.GClientKeywords.FileImpl('url'), None, None, None, None,
- None, 'DEPS', True),
- ],
- [])
+ [
+ gclient.Dependency(
+ obj.dependencies[0], 'foo/dir1', 'url', None, None, None, None,
+ None, 'DEPS', True, False),
+ gclient.Dependency(
+ obj.dependencies[0], 'foo/dir2',
+ gclient.GClientKeywords.FromImpl('bar'), None, None, None, None,
+ None, 'DEPS', True, False),
+ gclient.Dependency(
+ obj.dependencies[0], 'foo/dir3',
+ gclient.GClientKeywords.FileImpl('url'), None, None, None, None,
+ None, 'DEPS', True, False),
+ ],
+ [])
# Make sure __str__() works fine.
# pylint: disable=W0212
obj.dependencies[0]._file_list.append('foo')
@@ -567,7 +567,7 @@ class GclientTest(trial_dir.TestCase):
"""Verifies expected behavior of LateOverride."""
url = "git@github.com:dart-lang/spark.git"
d = gclient.Dependency(None, 'name', 'url',
- None, None, None, None, None, '', True)
+ None, None, None, None, None, '', True, False)
late_url = d.LateOverride(url)
self.assertEquals(url, late_url)
@@ -739,7 +739,44 @@ class GclientTest(trial_dir.TestCase):
'}\n'
'recursedeps = ["bar"]')
write(
- os.path.join('bar', 'DEPS'),
+ os.path.join('foo/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/bar', 'svn://example.com/foo/bar'),
+ ('foo/baz', 'svn://example.com/foo/bar/baz'),
+ ],
+ self._get_processed())
+
+ def testRelativeRecursion(self):
+ """Verifies that nested use_relative_paths is always respected."""
+ 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'
+ ' "bar": "/bar",\n'
+ '}\n'
+ 'recursedeps = ["bar"]')
+ write(
+ os.path.join('foo/bar', 'DEPS'),
+ 'use_relative_paths = True\n'
'deps = {\n'
' "baz": "/baz",\n'
'}')
@@ -756,9 +793,7 @@ class GclientTest(trial_dir.TestCase):
[
('foo', 'svn://example.com/foo'),
('foo/bar', 'svn://example.com/foo/bar'),
- # TODO(agable): Figure out why baz isn't included here. The
- # recursedeps = ["bar"] in foo's DEPS means that we should be
- # fetching the entries in bar's DEPS file, which includes baz.
+ ('foo/bar/baz', 'svn://example.com/foo/bar/baz'),
],
self._get_processed())
« no previous file with comments | « gclient.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698