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

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

Issue 2648323006: Use update_w3c_test_expectations directly in same process. (Closed)
Patch Set: Created 3 years, 11 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/webkitpy/w3c/deps_updater.py ('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 """A class for updating layout test expectations when updating w3c tests. 5 """A class for updating layout test expectations when updating w3c tests.
6 6
7 Specifically, this class fetches results from try bots for the current CL, and: 7 Specifically, this class fetches results from try bots for the current CL, and:
8 1. Downloads new baseline files for any tests that can be rebaselined. 8 1. Downloads new baseline files for any tests that can be rebaselined.
9 2. Updates the generic TestExpectations file for any other failing tests. 9 2. Updates the generic TestExpectations file for any other failing tests.
10 10
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 def write_to_test_expectations(self, line_list): 286 def write_to_test_expectations(self, line_list):
287 """Writes to TestExpectations. 287 """Writes to TestExpectations.
288 288
289 The place in the file where the new lines are inserted is after a 289 The place in the file where the new lines are inserted is after a
290 marker comment line. If this marker comment line is not found, it will 290 marker comment line. If this marker comment line is not found, it will
291 be added to the end of the file. 291 be added to the end of the file.
292 292
293 Args: 293 Args:
294 line_list: A list of lines to add to the TestExpectations file. 294 line_list: A list of lines to add to the TestExpectations file.
295 """ 295 """
296 _log.debug('Lines to write to TestExpectations: %r', line_list) 296 _log.info('Lines to write to TestExpectations:')
297 for line in line_list:
298 _log.info(' %s', line)
297 port = self.host.port_factory.get() 299 port = self.host.port_factory.get()
298 expectations_file_path = port.path_to_generic_test_expectations_file() 300 expectations_file_path = port.path_to_generic_test_expectations_file()
299 file_contents = self.host.filesystem.read_text_file(expectations_file_pa th) 301 file_contents = self.host.filesystem.read_text_file(expectations_file_pa th)
300 marker_comment_index = file_contents.find(MARKER_COMMENT) 302 marker_comment_index = file_contents.find(MARKER_COMMENT)
301 line_list = [line for line in line_list if self._test_name_from_expectat ion_string(line) not in file_contents] 303 line_list = [line for line in line_list if self._test_name_from_expectat ion_string(line) not in file_contents]
302 if not line_list: 304 if not line_list:
303 return 305 return
304 if marker_comment_index == -1: 306 if marker_comment_index == -1:
305 file_contents += '\n%s\n' % MARKER_COMMENT 307 file_contents += '\n%s\n' % MARKER_COMMENT
306 file_contents += '\n'.join(line_list) 308 file_contents += '\n'.join(line_list)
(...skipping 16 matching lines...) Expand all
323 325
324 Args: 326 Args:
325 tests_results: A dict mapping test name to platform to test results. 327 tests_results: A dict mapping test name to platform to test results.
326 328
327 Returns: 329 Returns:
328 An updated tests_results dictionary without the platform-specific 330 An updated tests_results dictionary without the platform-specific
329 testharness.js tests that required new baselines to be downloaded 331 testharness.js tests that required new baselines to be downloaded
330 from `webkit-patch rebaseline-cl`. 332 from `webkit-patch rebaseline-cl`.
331 """ 333 """
332 tests_to_rebaseline, tests_results = self.get_tests_to_rebaseline(tests_ results) 334 tests_to_rebaseline, tests_results = self.get_tests_to_rebaseline(tests_ results)
333 _log.debug('Tests to rebaseline: %r', tests_to_rebaseline) 335 _log.info('Tests to rebaseline:')
336 for test in tests_to_rebaseline:
337 _log.info(' %s', test)
334 if tests_to_rebaseline: 338 if tests_to_rebaseline:
335 webkit_patch = self.host.filesystem.join( 339 webkit_patch = self.host.filesystem.join(
336 self.finder.chromium_base(), self.finder.webkit_base(), self.fin der.path_to_script('webkit-patch')) 340 self.finder.chromium_base(), self.finder.webkit_base(), self.fin der.path_to_script('webkit-patch'))
337 self.host.executive.run_command([ 341 self.host.executive.run_command([
338 'python', 342 'python',
339 webkit_patch, 343 webkit_patch,
340 'rebaseline-cl', 344 'rebaseline-cl',
341 '--verbose', 345 '--verbose',
342 '--no-trigger-jobs', 346 '--no-trigger-jobs',
343 ] + tests_to_rebaseline) 347 ] + tests_to_rebaseline)
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 379
376 Args: 380 Args:
377 test_path: A file path relative to the layout tests directory. 381 test_path: A file path relative to the layout tests directory.
378 This might correspond to a deleted file or a non-test. 382 This might correspond to a deleted file or a non-test.
379 """ 383 """
380 absolute_path = self.host.filesystem.join(self.finder.layout_tests_dir() , test_path) 384 absolute_path = self.host.filesystem.join(self.finder.layout_tests_dir() , test_path)
381 test_parser = TestParser(absolute_path, self.host) 385 test_parser = TestParser(absolute_path, self.host)
382 if not test_parser.test_doc: 386 if not test_parser.test_doc:
383 return False 387 return False
384 return test_parser.is_jstest() 388 return test_parser.is_jstest()
OLDNEW
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698