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

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

Issue 2724953002: When uploading updates to baselines/expectations, pass patchset title with "-t". (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | 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 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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 message_lines.extend(' ' + d for d in directories) 422 message_lines.extend(' ' + d for d in directories)
423 return '\n'.join(message_lines) 423 return '\n'.join(message_lines)
424 424
425 def fetch_new_expectations_and_baselines(self): 425 def fetch_new_expectations_and_baselines(self):
426 """Adds new expectations and downloads baselines based on try job result s, then commits and uploads the change.""" 426 """Adds new expectations and downloads baselines based on try job result s, then commits and uploads the change."""
427 _log.info('Adding test expectations lines to LayoutTests/TestExpectation s.') 427 _log.info('Adding test expectations lines to LayoutTests/TestExpectation s.')
428 expectation_updater = WPTExpectationsUpdater(self.host) 428 expectation_updater = WPTExpectationsUpdater(self.host)
429 expectation_updater.run(args=[]) 429 expectation_updater.run(args=[])
430 message = 'Update test expectations and baselines.' 430 message = 'Update test expectations and baselines.'
431 self.check_run(['git', 'commit', '-a', '-m', message]) 431 self.check_run(['git', 'commit', '-a', '-m', message])
432 self.git_cl.run(['upload', '-m', message, '--gerrit']) 432 self.git_cl.run(['upload', '-t', message, '--gerrit'])
tandrii(chromium) 2017/03/02 14:49:28 this will work for re-upload, but for initial uplo
433 433
434 def update_all_test_expectations_files(self, deleted_tests, renamed_tests): 434 def update_all_test_expectations_files(self, deleted_tests, renamed_tests):
435 """Updates all test expectations files for tests that have been deleted or renamed.""" 435 """Updates all test expectations files for tests that have been deleted or renamed."""
436 port = self.host.port_factory.get() 436 port = self.host.port_factory.get()
437 for path, file_contents in port.all_expectations_dict().iteritems(): 437 for path, file_contents in port.all_expectations_dict().iteritems():
438 parser = TestExpectationParser(port, all_tests=None, is_lint_mode=Fa lse) 438 parser = TestExpectationParser(port, all_tests=None, is_lint_mode=Fa lse)
439 expectation_lines = parser.parse(path, file_contents) 439 expectation_lines = parser.parse(path, file_contents)
440 self._update_single_test_expectations_file(path, expectation_lines, deleted_tests, renamed_tests) 440 self._update_single_test_expectations_file(path, expectation_lines, deleted_tests, renamed_tests)
441 441
442 def _update_single_test_expectations_file(self, path, expectation_lines, del eted_tests, renamed_tests): 442 def _update_single_test_expectations_file(self, path, expectation_lines, del eted_tests, renamed_tests):
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 """Returns a dict mapping source to dest name for layout tests that have been renamed.""" 474 """Returns a dict mapping source to dest name for layout tests that have been renamed."""
475 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff- filter=R', '--name-status']) 475 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff- filter=R', '--name-status'])
476 renamed_tests = {} 476 renamed_tests = {}
477 for line in out.splitlines(): 477 for line in out.splitlines():
478 _, source_path, dest_path = line.split() 478 _, source_path, dest_path = line.split()
479 source_test = self.finder.layout_test_name(source_path) 479 source_test = self.finder.layout_test_name(source_path)
480 dest_test = self.finder.layout_test_name(dest_path) 480 dest_test = self.finder.layout_test_name(dest_path)
481 if source_test and dest_test: 481 if source_test and dest_test:
482 renamed_tests[source_test] = dest_test 482 renamed_tests[source_test] = dest_test
483 return renamed_tests 483 return renamed_tests
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698