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

Unified Diff: tests/gclient_test.py

Issue 368713002: Add fallback to DEPS from a missing deps file. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: update test Created 6 years, 6 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 | « tests/gclient_smoketest.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 fb6577913e248408e84a689219b4cc2fd4ba35c8..0d5b235a7c6e15541b2925812a876b9520b53ef5 100755
--- a/tests/gclient_test.py
+++ b/tests/gclient_test.py
@@ -809,6 +809,66 @@ class GclientTest(trial_dir.TestCase):
],
self._get_processed())
+ def testGitDeps(self):
+ """Verifies gclient respects a .DEPS.git deps file.
+
+ Along the way, we also test that if both DEPS and .DEPS.git are present,
+ that gclient does not read the DEPS file. This will reliably catch bugs
+ where gclient is always hitting the wrong file (DEPS).
+ """
+ write(
+ '.gclient',
+ 'solutions = [\n'
+ ' { "name": "foo", "url": "svn://example.com/foo",\n'
+ ' "deps_file" : ".DEPS.git",\n'
+ ' },\n'
+ ']')
+ write(
+ os.path.join('foo', '.DEPS.git'),
+ 'deps = {\n'
+ ' "bar": "/bar",\n'
+ '}')
+ write(
+ os.path.join('foo', 'DEPS'),
+ 'deps = {\n'
+ ' "baz": "/baz",\n'
+ '}')
+
+ options, _ = gclient.OptionParser().parse_args([])
+ obj = gclient.GClient.LoadCurrentConfig(options)
+ obj.RunOnDeps('None', [])
+ self.assertEquals(
+ [
+ 'svn://example.com/foo',
+ 'svn://example.com/foo/bar',
+ ],
+ self._get_processed())
+
+ def testGitDepsFallback(self):
+ """Verifies gclient respects fallback to DEPS upon missing deps file."""
+ write(
+ '.gclient',
+ 'solutions = [\n'
+ ' { "name": "foo", "url": "svn://example.com/foo",\n'
+ ' "deps_file" : ".DEPS.git",\n'
+ ' },\n'
+ ']')
+ write(
+ os.path.join('foo', 'DEPS'),
+ 'deps = {\n'
+ ' "bar": "/bar",\n'
+ '}')
+
+ options, _ = gclient.OptionParser().parse_args([])
+ obj = gclient.GClient.LoadCurrentConfig(options)
+ obj.RunOnDeps('None', [])
+ self.assertEquals(
+ [
+ 'svn://example.com/foo',
+ 'svn://example.com/foo/bar',
+ ],
+ self._get_processed())
+
if __name__ == '__main__':
sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout)
« no previous file with comments | « tests/gclient_smoketest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698