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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py

Issue 2663623003: Simplify the initialization of Git objects in Host. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Fetches a copy of the latest state of a W3C test repository and commits. 5 """Fetches a copy of the latest state of a W3C test repository and commits.
6 6
7 If this script is given the argument --auto-update, it will also: 7 If this script is given the argument --auto-update, it will also:
8 1. Upload a CL. 8 1. Upload a CL.
9 2. Trigger try jobs and wait for them to complete. 9 2. Trigger try jobs and wait for them to complete.
10 3. Make any changes that are required for new failing tests. 10 3. Make any changes that are required for new failing tests.
(...skipping 21 matching lines...) Expand all
32 POLL_DELAY_SECONDS = 2 * 60 32 POLL_DELAY_SECONDS = 2 * 60
33 TIMEOUT_SECONDS = 180 * 60 33 TIMEOUT_SECONDS = 180 * 60
34 34
35 _log = logging.getLogger(__file__) 35 _log = logging.getLogger(__file__)
36 36
37 37
38 class TestImporter(object): 38 class TestImporter(object):
39 39
40 def __init__(self, host): 40 def __init__(self, host):
41 self.host = host 41 self.host = host
42 self.host.initialize_scm()
43 self.executive = host.executive 42 self.executive = host.executive
44 self.fs = host.filesystem 43 self.fs = host.filesystem
45 self.finder = WebKitFinder(self.fs) 44 self.finder = WebKitFinder(self.fs)
46 self.verbose = False 45 self.verbose = False
47 self.git_cl = None 46 self.git_cl = None
48 47
49 def main(self, argv=None): 48 def main(self, argv=None):
50 options = self.parse_args(argv) 49 options = self.parse_args(argv)
51 self.verbose = options.verbose 50 self.verbose = options.verbose
52 log_level = logging.DEBUG if self.verbose else logging.INFO 51 log_level = logging.DEBUG if self.verbose else logging.INFO
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 """Returns a dict mapping source to dest name for layout tests that have been renamed.""" 436 """Returns a dict mapping source to dest name for layout tests that have been renamed."""
438 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff- filter=R', '--name-status']) 437 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff- filter=R', '--name-status'])
439 renamed_tests = {} 438 renamed_tests = {}
440 for line in out.splitlines(): 439 for line in out.splitlines():
441 _, source_path, dest_path = line.split() 440 _, source_path, dest_path = line.split()
442 source_test = self.finder.layout_test_name(source_path) 441 source_test = self.finder.layout_test_name(source_path)
443 dest_test = self.finder.layout_test_name(dest_path) 442 dest_test = self.finder.layout_test_name(dest_path)
444 if source_test and dest_test: 443 if source_test and dest_test:
445 renamed_tests[source_test] = dest_test 444 renamed_tests[source_test] = dest_test
446 return renamed_tests 445 return renamed_tests
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698