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

Unified Diff: trunk/tools/depot_tools/tests/gclient_smoketest.py

Issue 146583013: Revert 250482 "Re-reland r245404 ("If the destination directory ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 10 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 | « trunk/tools/depot_tools/tests/gclient_scm_test.py ('k') | trunk/tools/depot_tools/tests/scm_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/tools/depot_tools/tests/gclient_smoketest.py
===================================================================
--- trunk/tools/depot_tools/tests/gclient_smoketest.py (revision 250877)
+++ trunk/tools/depot_tools/tests/gclient_smoketest.py (working copy)
@@ -13,7 +13,6 @@
import logging
import os
import re
-import socket
import subprocess
import sys
import unittest
@@ -110,9 +109,9 @@
not re.match(
r'_____ [^ ]+ : Attempting rebase onto [0-9a-f]+...',
line) and
- not re.match(r'_____ [^ ]+ at [^ ]+', line) and not
- re.match(r'________ (.*) looks like git-svn; skipping.', line)):
- # The regexp above are a bit too broad.
+ not re.match(r'_____ [^ ]+ at [^ ]+', line)):
+ # The two regexp above are a bit too broad, they are necessary only
+ # for git checkouts.
self.fail(line)
else:
results.append([[match.group(1), match.group(2), match.group(3)]])
@@ -777,58 +776,9 @@
# Cripple src/third_party/foo and make sure gclient still succeeds.
gclient_utils.rmtree(join(third_party, 'foo', '.svn'))
- self.assertEquals(0, self.gclient(cmd + ['--force'])[-1])
+ self.assertEquals(0, self.gclient(cmd)[-1])
- def testSkipGitSvn(self):
- # Check that gclient skips git-svn checkouts.
- if not self.enabled:
- return
- # Create the .gclient file.
- svn_url = self.svn_base + 'trunk/src'
- self.gclient(['config', svn_url], cwd=self.root_dir)
-
- # Create a git-svn checkout.
- # Use check_output to hide the output from the subprocess.
- subprocess2.check_output(['git', 'svn', 'clone', svn_url],
- cwd=self.root_dir)
-
- # Ensure that gclient skips the git-svn checkout.
- stdout, stderr, rc = self.gclient(['sync', '--jobs', '1'])
- self.assertEquals(rc, 0)
- self.assertFalse(stderr)
- self.assertTrue('________ src looks like git-svn; skipping.' in stdout)
- self.checkBlock(stdout, [
- ['running', self.root_dir],
- ['running', os.path.join(self.root_dir, 'src', 'file', 'other')],
- ['running', self.root_dir],
- ['running', self.root_dir],
- ['running', self.root_dir],
- ['running', self.root_dir],
- ['running', self.root_dir],
- ])
-
- # But, we still need the DEPS to be checked out...
- foo_dir = os.path.join(self.root_dir, 'src', 'third_party', 'foo')
- foo_rev = subprocess2.check_output(['svnversion', foo_dir]).strip()
- self.assertEquals(foo_rev, '1')
-
- other_dir = os.path.join(self.root_dir, 'src', 'other')
- other_rev = subprocess2.check_output(['svnversion', other_dir]).strip()
- self.assertEquals(other_rev, '2')
-
- # Verify that the DEPS are NOT skipped on a second update.
- stdout, stderr, rc = self.gclient(['sync', '--jobs', '1'])
- self.assertFalse(stderr)
- self.assertTrue('________ src looks like git-svn; skipping.' in stdout)
- self.assertFalse(
- '________ src/other looks like git-svn; skipping.' in stdout,
- 'Non git-svn checkout is incorrectly skipped.')
- self.assertFalse(
- '________ src/third_party/foo looks like git-svn; skipping.' in stdout,
- 'Non git-svn checkout is incorrectly skipped.')
-
-
class GClientSmokeSVNTransitive(GClientSmokeBase):
FAKE_REPOS_CLASS = FakeRepoTransitive
@@ -1153,7 +1103,7 @@
self.assertTree(tree)
# Pre-DEPS hooks run when syncing with --nohooks.
- self.gclient(['sync', '--deps', 'mac', '--nohooks', '--force',
+ self.gclient(['sync', '--deps', 'mac', '--nohooks',
'--revision', 'src@' + self.githash('repo_5', 2)])
tree = self.mangle_git_tree(('repo_5@2', 'src'),
('repo_1@2', 'src/repo1'),
@@ -1165,7 +1115,7 @@
os.remove(join(self.root_dir, 'src', 'git_pre_deps_hooked'))
# Pre-DEPS hooks don't run with --noprehooks
- self.gclient(['sync', '--deps', 'mac', '--noprehooks', '--force',
+ self.gclient(['sync', '--deps', 'mac', '--noprehooks',
'--revision', 'src@' + self.githash('repo_5', 2)])
tree = self.mangle_git_tree(('repo_5@2', 'src'),
('repo_1@2', 'src/repo1'),
@@ -1393,82 +1343,7 @@
self.assertEquals(sorted(entries), sorted(expected))
- # TODO(borenet): Enable this at the same time that the guard is removed in
- # gclient.
- if (os.environ.get('CHROME_HEADLESS') and
- socket.gethostname() in ('vm859-m1', 'build1-m1', 'vm630-m1')):
- def testDeleteConflictingCheckout(self):
- if not self.enabled:
- return
-
- # Create an initial svn checkout.
- self.gclient(['config', '--spec',
- 'solutions=['
- '{"name": "src",'
- ' "url": "' + self.svn_base + 'trunk/src"},'
- ']'
- ])
- results = self.gclient(['sync', '--deps', 'mac'])
- self.assertEqual(results[2], 0, 'Sync failed!')
-
- # Verify that we have the expected svn checkout.
- results = self.gclient(['revinfo', '--deps', 'mac'])
- actual = results[0].splitlines()
- expected = [
- 'src: %strunk/src' % self.svn_base,
- 'src/file/other: File("%strunk/other/DEPS")' % self.svn_base,
- 'src/other: %strunk/other' % self.svn_base,
- 'src/third_party/foo: %strunk/third_party/foo@1' % self.svn_base,
- ]
- self.assertEquals(actual, expected)
-
- # Change the desired checkout to git.
- self.gclient(['config', '--spec',
- 'solutions=['
- '{"name": "src",'
- ' "url": "' + self.git_base + 'repo_1"},'
- ']'
- ])
-
- # Verify that the sync succeeds with --force.
- results = self.gclient(['sync', '--deps', 'mac', '--force'])
- self.assertEqual(results[2], 0, 'Sync failed!')
-
- # Verify that we got the desired git checkout.
- results = self.gclient(['revinfo', '--deps', 'mac'])
- actual = results[0].splitlines()
- expected = [
- 'src: %srepo_1' % self.git_base,
- 'src/repo2: %srepo_2@%s' % (self.git_base,
- self.githash('repo_2', 1)[:7]),
- 'src/repo2/repo_renamed: %srepo_3' % self.git_base,
- ]
- self.assertEquals(actual, expected)
-
- # Change the desired checkout back to svn.
- self.gclient(['config', '--spec',
- 'solutions=['
- '{"name": "src",'
- ' "url": "' + self.svn_base + 'trunk/src"},'
- ']'
- ])
-
- # Verify that the sync succeeds.
- results = self.gclient(['sync', '--deps', 'mac', '--force'])
- self.assertEqual(results[2], 0, 'Sync failed!')
-
- # Verify that we have the expected svn checkout.
- results = self.gclient(['revinfo', '--deps', 'mac'])
- actual = results[0].splitlines()
- expected = [
- 'src: %strunk/src' % self.svn_base,
- 'src/file/other: File("%strunk/other/DEPS")' % self.svn_base,
- 'src/other: %strunk/other' % self.svn_base,
- 'src/third_party/foo: %strunk/third_party/foo@1' % self.svn_base,
- ]
- self.assertEquals(actual, expected)
-
class GClientSmokeFromCheckout(GClientSmokeBase):
# WebKit abuses this. It has a .gclient and a DEPS from a checkout.
def setUp(self):
« no previous file with comments | « trunk/tools/depot_tools/tests/gclient_scm_test.py ('k') | trunk/tools/depot_tools/tests/scm_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698