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

Unified Diff: tests/gclient_smoketest.py

Issue 2162583004: Revert "Remove all safesync_url functionality from gclient" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 4 years, 5 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_scm_test.py ('k') | tests/gclient_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/gclient_smoketest.py
diff --git a/tests/gclient_smoketest.py b/tests/gclient_smoketest.py
index cefd7b00ceebecdbefe2028a7ff1605d2377a439..50e7fd72c0ac2d20e2bad5a41bc5a52016f57c6e 100755
--- a/tests/gclient_smoketest.py
+++ b/tests/gclient_smoketest.py
@@ -205,36 +205,52 @@ class GClientSmoke(GClientSmokeBase):
test(['config', self.svn_base + 'trunk/src/'],
('solutions = [\n'
- ' {\n'
- ' "name" : "src",\n'
+ ' { "name" : "src",\n'
' "url" : "%strunk/src",\n'
' "deps_file" : "DEPS",\n'
- ' "managed" : False,\n'
- ' "custom_deps" : {},\n'
+ ' "managed" : True,\n'
+ ' "custom_deps" : {\n'
+ ' },\n'
+ ' "safesync_url": "",\n'
' },\n'
']\n'
'cache_dir = None\n') % self.svn_base)
test(['config', self.git_base + 'repo_1', '--name', 'src'],
('solutions = [\n'
- ' {\n'
- ' "name" : "src",\n'
+ ' { "name" : "src",\n'
' "url" : "%srepo_1",\n'
' "deps_file" : "DEPS",\n'
- ' "managed" : False,\n'
- ' "custom_deps" : {},\n'
+ ' "managed" : True,\n'
+ ' "custom_deps" : {\n'
+ ' },\n'
+ ' "safesync_url": "",\n'
' },\n'
']\n'
'cache_dir = None\n') % self.git_base)
+ test(['config', 'foo', 'faa'],
+ 'solutions = [\n'
+ ' { "name" : "foo",\n'
+ ' "url" : "foo",\n'
+ ' "deps_file" : "DEPS",\n'
+ ' "managed" : True,\n'
+ ' "custom_deps" : {\n'
+ ' },\n'
+ ' "safesync_url": "faa",\n'
+ ' },\n'
+ ']\n'
+ 'cache_dir = None\n')
+
test(['config', 'foo', '--deps', 'blah'],
'solutions = [\n'
- ' {\n'
- ' "name" : "foo",\n'
+ ' { "name" : "foo",\n'
' "url" : "foo",\n'
' "deps_file" : "blah",\n'
- ' "managed" : False,\n'
- ' "custom_deps" : {},\n'
+ ' "managed" : True,\n'
+ ' "custom_deps" : {\n'
+ ' },\n'
+ ' "safesync_url": "",\n'
' },\n'
']\n'
'cache_dir = None\n')
@@ -243,7 +259,7 @@ class GClientSmoke(GClientSmokeBase):
os.remove(p)
results = self.gclient(['config', 'foo', 'faa', 'fuu'])
- err = ('Usage: gclient.py config [options] [url]\n\n'
+ err = ('Usage: gclient.py config [options] [url] [safesync url]\n\n'
'gclient.py: error: Inconsistent arguments. Use either --spec or one'
' or 2 args\n')
self.check(('', err, 2), results)
@@ -287,14 +303,14 @@ class GClientSmokeGIT(GClientSmokeBase):
super(GClientSmokeGIT, self).setUp()
self.enabled = self.FAKE_REPOS.set_up_git()
- def testSyncManaged(self):
+ def testSync(self):
if not self.enabled:
return
- self.gclient([
- 'config', self.git_base + 'repo_1', '--name', 'src', '--managed'])
+ # TODO(maruel): safesync.
+ self.gclient(['config', self.git_base + 'repo_1', '--name', 'src'])
# Test unversioned checkout.
self.parseGclient(
- ['sync', '--deps', 'mac', '--jobs', '8'],
+ ['sync', '--deps', 'mac', '--jobs', '1'],
['running', 'running'])
# TODO(maruel): http://crosbug.com/3582 hooks run even if not matching, must
# add sync parsing to get the list of updated files.
@@ -312,7 +328,7 @@ class GClientSmokeGIT(GClientSmokeBase):
# Test incremental versioned sync: sync backward.
self.parseGclient(
['sync', '--jobs', '1', '--revision',
- 'src@' + self.githash('repo_1', 1), '--jobs', '1',
+ 'src@' + self.githash('repo_1', 1),
'--deps', 'mac', '--delete_unversioned_trees'],
['deleting'])
tree = self.mangle_git_tree(('repo_1@1', 'src'),
@@ -323,7 +339,7 @@ class GClientSmokeGIT(GClientSmokeBase):
self.assertTree(tree)
# Test incremental sync: delete-unversioned_trees isn't there.
self.parseGclient(
- ['sync', '--deps', 'mac', '--jobs', '8'],
+ ['sync', '--deps', 'mac', '--jobs', '1'],
['running', 'running'])
tree = self.mangle_git_tree(('repo_1@2', 'src'),
('repo_2@1', 'src/repo2'),
@@ -367,6 +383,56 @@ class GClientSmokeGIT(GClientSmokeBase):
('repo_4@2', 'src/repo4'))
self.assertTree(tree)
+ def testSyncJobs(self):
+ if not self.enabled:
+ return
+ # TODO(maruel): safesync.
+ self.gclient(['config', self.git_base + 'repo_1', '--name', 'src'])
+ # Test unversioned checkout.
+ self.parseGclient(
+ ['sync', '--deps', 'mac', '--jobs', '8'],
+ ['running', 'running'],
+ untangle=True)
+ # TODO(maruel): http://crosbug.com/3582 hooks run even if not matching, must
+ # add sync parsing to get the list of updated files.
+ tree = self.mangle_git_tree(('repo_1@2', 'src'),
+ ('repo_2@1', 'src/repo2'),
+ ('repo_3@2', 'src/repo2/repo_renamed'))
+ tree['src/git_hooked1'] = 'git_hooked1'
+ tree['src/git_hooked2'] = 'git_hooked2'
+ self.assertTree(tree)
+
+ # Manually remove git_hooked1 before synching to make sure it's not
+ # recreated.
+ os.remove(join(self.root_dir, 'src', 'git_hooked1'))
+
+ # Test incremental versioned sync: sync backward.
+ # Use --jobs 1 otherwise the order is not deterministic.
+ self.parseGclient(
+ ['sync', '--revision', 'src@' + self.githash('repo_1', 1),
+ '--deps', 'mac', '--delete_unversioned_trees', '--jobs', '1'],
+ ['deleting'],
+ untangle=True)
+ tree = self.mangle_git_tree(('repo_1@1', 'src'),
+ ('repo_2@2', 'src/repo2'),
+ ('repo_3@1', 'src/repo2/repo3'),
+ ('repo_4@2', 'src/repo4'))
+ tree['src/git_hooked2'] = 'git_hooked2'
+ self.assertTree(tree)
+ # Test incremental sync: delete-unversioned_trees isn't there.
+ self.parseGclient(
+ ['sync', '--deps', 'mac', '--jobs', '8'],
+ ['running', 'running'],
+ untangle=True)
+ tree = self.mangle_git_tree(('repo_1@2', 'src'),
+ ('repo_2@1', 'src/repo2'),
+ ('repo_3@1', 'src/repo2/repo3'),
+ ('repo_3@2', 'src/repo2/repo_renamed'),
+ ('repo_4@2', 'src/repo4'))
+ tree['src/git_hooked1'] = 'git_hooked1'
+ tree['src/git_hooked2'] = 'git_hooked2'
+ self.assertTree(tree)
+
def testRunHooks(self):
if not self.enabled:
return
« no previous file with comments | « tests/gclient_scm_test.py ('k') | tests/gclient_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698