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

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

Issue 2253163002: Minor refactoring: Move set-up of host and port into update_w3c_test_expectations.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « third_party/WebKit/Tools/Scripts/update-w3c-test-expectations ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 """Functionality for adding TestExpectations lines and downloading baselines 5 """Functionality for adding TestExpectations lines and downloading baselines
6 based on layout test failures in try jobs. 6 based on layout test failures in try jobs.
7 7
8 This script is used as part of the w3c test auto-import process. 8 This script is used as part of the w3c test auto-import process.
9 """ 9 """
10 10
11 import logging 11 import logging
12 12
13 from webkitpy.common.net import rietveld 13 from webkitpy.common.net import rietveld
14 from webkitpy.common.net.buildbot import BuildBot 14 from webkitpy.common.net.buildbot import BuildBot
15 from webkitpy.common.webkit_finder import WebKitFinder 15 from webkitpy.common.webkit_finder import WebKitFinder
16 from webkitpy.w3c.test_parser import TestParser 16 from webkitpy.w3c.test_parser import TestParser
17 17
18 _log = logging.getLogger(__name__) 18 _log = logging.getLogger(__name__)
19 19
20 20
21 def main(host, port): 21 def main(host):
22 host.initialize_scm()
23 port = host.port_factory.get()
22 expectations_file = port.path_to_generic_test_expectations_file() 24 expectations_file = port.path_to_generic_test_expectations_file()
23 expectations_line_adder = W3CExpectationsLineAdder(host) 25 expectations_line_adder = W3CExpectationsLineAdder(host)
24 issue_number = expectations_line_adder.get_issue_number() 26 issue_number = expectations_line_adder.get_issue_number()
25 try_bots = expectations_line_adder.get_try_bots() 27 try_bots = expectations_line_adder.get_try_bots()
26 try_jobs = rietveld.latest_try_jobs(issue_number, try_bots, host.web) 28 try_jobs = rietveld.latest_try_jobs(issue_number, try_bots, host.web)
27 test_expectations = {} 29 test_expectations = {}
28 if not try_jobs: 30 if not try_jobs:
29 print 'No Try Job information was collected.' 31 print 'No Try Job information was collected.'
30 return 1 32 return 1
31 33
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 for platform in tests_results[test_path].keys(): 325 for platform in tests_results[test_path].keys():
324 if tests_results[test_path][platform]['actual'] not in ['CRA SH', 'TIMEOUT']: 326 if tests_results[test_path][platform]['actual'] not in ['CRA SH', 'TIMEOUT']:
325 del tests_results[test_path][platform] 327 del tests_results[test_path][platform]
326 tests_to_rebaseline.add(test_path) 328 tests_to_rebaseline.add(test_path)
327 return list(tests_to_rebaseline), tests_results 329 return list(tests_to_rebaseline), tests_results
328 330
329 def is_js_test(self, webkit_finder, test_path): 331 def is_js_test(self, webkit_finder, test_path):
330 absolute_path = self._host.filesystem.join(webkit_finder.chromium_base() , test_path) 332 absolute_path = self._host.filesystem.join(webkit_finder.chromium_base() , test_path)
331 test_parser = TestParser(absolute_path, self._host) 333 test_parser = TestParser(absolute_path, self._host)
332 return test_parser.is_jstest() 334 return test_parser.is_jstest()
OLDNEW
« no previous file with comments | « third_party/WebKit/Tools/Scripts/update-w3c-test-expectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698