| 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 '--only-changed-tests', | 317 '--only-changed-tests', |
| 318 ] + tests_to_rebaseline) | 318 ] + tests_to_rebaseline) |
| 319 # NOTE(qyearsley): If rebaseline-cl is changed to stage all new file
s | 319 # NOTE(qyearsley): If rebaseline-cl is changed to stage all new file
s |
| 320 # with git, then this would be unnecessary and should be removed. | 320 # with git, then this would be unnecessary and should be removed. |
| 321 self.host.executive.run_command(['git', 'add', '--all']) | 321 self.host.executive.run_command(['git', 'add', '--all']) |
| 322 return tests_results | 322 return tests_results |
| 323 | 323 |
| 324 def get_modified_existing_tests(self): | 324 def get_modified_existing_tests(self): |
| 325 """Returns a list of layout test names for layout tests that have been m
odified.""" | 325 """Returns a list of layout test names for layout tests that have been m
odified.""" |
| 326 diff_output = self.host.executive.run_command( | 326 diff_output = self.host.executive.run_command( |
| 327 ['git', 'diff', 'origin/master', '--name-only', '-diff-filter=AMR'])
# Added, modified, and renamed files. | 327 ['git', 'diff', 'origin/master', '--name-only', '--diff-filter=AMR']
) # Added, modified, and renamed files. |
| 328 paths_from_chromium_root = diff_output.splitlines() | 328 paths_from_chromium_root = diff_output.splitlines() |
| 329 modified_tests = [] | 329 modified_tests = [] |
| 330 for path in paths_from_chromium_root: | 330 for path in paths_from_chromium_root: |
| 331 absolute_path = self.host.filesystem.join(self.finder.chromium_base(
), path) | 331 absolute_path = self.host.filesystem.join(self.finder.chromium_base(
), path) |
| 332 if not self.host.filesystem.exists(absolute_path): | 332 if not self.host.filesystem.exists(absolute_path): |
| 333 _log.warning('File does not exist: %s', absolute_path) | 333 _log.warning('File does not exist: %s', absolute_path) |
| 334 continue | 334 continue |
| 335 test_path = self.finder.layout_test_name(path) | 335 test_path = self.finder.layout_test_name(path) |
| 336 if test_path: | 336 if test_path: |
| 337 modified_tests.append(test_path) | 337 modified_tests.append(test_path) |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 | 371 |
| 372 Args: | 372 Args: |
| 373 test_path: A file path relative to the layout tests directory. | 373 test_path: A file path relative to the layout tests directory. |
| 374 This might correspond to a deleted file or a non-test. | 374 This might correspond to a deleted file or a non-test. |
| 375 """ | 375 """ |
| 376 absolute_path = self.host.filesystem.join(self.finder.layout_tests_dir()
, test_path) | 376 absolute_path = self.host.filesystem.join(self.finder.layout_tests_dir()
, test_path) |
| 377 test_parser = TestParser(absolute_path, self.host) | 377 test_parser = TestParser(absolute_path, self.host) |
| 378 if not test_parser.test_doc: | 378 if not test_parser.test_doc: |
| 379 return False | 379 return False |
| 380 return test_parser.is_jstest() | 380 return test_parser.is_jstest() |
| OLD | NEW |