| OLD | NEW |
| 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 _log.debug('Tests to rebaseline: %r', tests_to_rebaseline) | 306 _log.debug('Tests to rebaseline: %r', tests_to_rebaseline) |
| 307 if tests_to_rebaseline: | 307 if tests_to_rebaseline: |
| 308 webkit_patch = self.host.filesystem.join( | 308 webkit_patch = self.host.filesystem.join( |
| 309 self.finder.chromium_base(), self.finder.webkit_base(), self.fin
der.path_to_script('webkit-patch')) | 309 self.finder.chromium_base(), self.finder.webkit_base(), self.fin
der.path_to_script('webkit-patch')) |
| 310 self.host.executive.run_command([ | 310 self.host.executive.run_command([ |
| 311 'python', | 311 'python', |
| 312 webkit_patch, | 312 webkit_patch, |
| 313 'rebaseline-cl', | 313 'rebaseline-cl', |
| 314 '--verbose', | 314 '--verbose', |
| 315 '--no-trigger-jobs', | 315 '--no-trigger-jobs', |
| 316 '--only-changed-tests', | |
| 317 ] + tests_to_rebaseline) | 316 ] + tests_to_rebaseline) |
| 318 return tests_results | 317 return tests_results |
| 319 | 318 |
| 320 def get_modified_existing_tests(self): | 319 def get_modified_existing_tests(self): |
| 321 """Returns a list of layout test names for layout tests that have been m
odified.""" | 320 """Returns a list of layout test names for layout tests that have been m
odified.""" |
| 322 diff_output = self.host.executive.run_command( | 321 diff_output = self.host.executive.run_command( |
| 323 ['git', 'diff', 'origin/master', '--name-only', '--diff-filter=AMR']
) # Added, modified, and renamed files. | 322 ['git', 'diff', 'origin/master', '--name-only', '--diff-filter=AMR']
) # Added, modified, and renamed files. |
| 324 paths_from_chromium_root = diff_output.splitlines() | 323 paths_from_chromium_root = diff_output.splitlines() |
| 325 modified_tests = [] | 324 modified_tests = [] |
| 326 for path in paths_from_chromium_root: | 325 for path in paths_from_chromium_root: |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 | 366 |
| 368 Args: | 367 Args: |
| 369 test_path: A file path relative to the layout tests directory. | 368 test_path: A file path relative to the layout tests directory. |
| 370 This might correspond to a deleted file or a non-test. | 369 This might correspond to a deleted file or a non-test. |
| 371 """ | 370 """ |
| 372 absolute_path = self.host.filesystem.join(self.finder.layout_tests_dir()
, test_path) | 371 absolute_path = self.host.filesystem.join(self.finder.layout_tests_dir()
, test_path) |
| 373 test_parser = TestParser(absolute_path, self.host) | 372 test_parser = TestParser(absolute_path, self.host) |
| 374 if not test_parser.test_doc: | 373 if not test_parser.test_doc: |
| 375 return False | 374 return False |
| 376 return test_parser.is_jstest() | 375 return test_parser.is_jstest() |
| OLD | NEW |