mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
depot_tools: Fix gclient_test on Windows.
Bug: 1007580 Change-Id: I8265b3f4e64b95d7f107b50eb8c68983d6002468 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1828080 Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org> Reviewed-by: Anthony Polito <apolito@google.com>
This commit is contained in:
committed by
Commit Bot
parent
b9aca9494e
commit
451e8babe2
@@ -73,7 +73,6 @@ def CommonChecks(input_api, output_api, tests_to_black_list, run_on_python3):
|
||||
r'.*download_from_google_storage_unittest\.py$',
|
||||
r'.*gclient_scm_test\.py$',
|
||||
r'.*gclient_smoketest\.py$',
|
||||
r'.*gclient_test\.py$',
|
||||
r'.*git_cache_test\.py$',
|
||||
r'.*git_cl_test\.py$',
|
||||
r'.*git_common_test\.py$',
|
||||
|
||||
10
git_cache.py
10
git_cache.py
@@ -69,7 +69,7 @@ def exponential_backoff_retry(fn, excs=(Exception,), name=None, count=10,
|
||||
Returns: The return value of the successful fn.
|
||||
"""
|
||||
printerr = printerr or logging.warning
|
||||
for i in xrange(count):
|
||||
for i in range(count):
|
||||
try:
|
||||
return fn()
|
||||
except excs as e:
|
||||
@@ -268,7 +268,13 @@ class Mirror(object):
|
||||
def UrlToCacheDir(url):
|
||||
"""Convert a git url to a normalized form for the cache dir path."""
|
||||
parsed = urlparse.urlparse(url)
|
||||
norm_url = parsed.netloc + parsed.path
|
||||
# Get rid of the port. This is only needed for Windows tests, since tests
|
||||
# serve git from git://localhost:port/git, but Windows doesn't like ':' in
|
||||
# paths.
|
||||
netloc = parsed.netloc
|
||||
if ':' in netloc:
|
||||
netloc = netloc.split(':', 1)[0]
|
||||
norm_url = netloc + parsed.path
|
||||
if norm_url.endswith('.git'):
|
||||
norm_url = norm_url[:-len('.git')]
|
||||
|
||||
|
||||
@@ -802,8 +802,8 @@ class GclientTest(trial_dir.TestCase):
|
||||
self.assertEqual(
|
||||
[
|
||||
('foo', 'svn://example.com/foo'),
|
||||
('foo/bar', 'svn://example.com/bar'),
|
||||
('foo/baz', 'svn://example.com/baz'),
|
||||
(os.path.join('foo', 'bar'), 'svn://example.com/bar'),
|
||||
(os.path.join('foo', 'baz'), 'svn://example.com/baz'),
|
||||
],
|
||||
self._get_processed())
|
||||
|
||||
@@ -839,8 +839,8 @@ class GclientTest(trial_dir.TestCase):
|
||||
self.assertEqual(
|
||||
[
|
||||
('foo', 'svn://example.com/foo'),
|
||||
('foo/bar', 'svn://example.com/bar'),
|
||||
('foo/bar/baz', 'svn://example.com/baz'),
|
||||
(os.path.join('foo', 'bar'), 'svn://example.com/bar'),
|
||||
(os.path.join('foo', 'bar', 'baz'), 'svn://example.com/baz'),
|
||||
],
|
||||
self._get_processed())
|
||||
|
||||
@@ -878,8 +878,8 @@ class GclientTest(trial_dir.TestCase):
|
||||
self.assertEqual(
|
||||
[
|
||||
('foo', 'svn://example.com/foo'),
|
||||
('foo/third_party/bar', 'svn://example.com/bar'),
|
||||
('foo/third_party/baz', 'svn://example.com/baz'),
|
||||
(os.path.join('foo', 'third_party', 'bar'), 'svn://example.com/bar'),
|
||||
(os.path.join('foo', 'third_party', 'baz'), 'svn://example.com/baz'),
|
||||
],
|
||||
self._get_processed())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user