| OLD | NEW |
| 1 # Copyright (c) 2010, Google Inc. All rights reserved. | 1 # Copyright (c) 2010, Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 self._results = parsed_json | 107 self._results = parsed_json |
| 108 self._chromium_revision = chromium_revision | 108 self._chromium_revision = chromium_revision |
| 109 | 109 |
| 110 def run_was_interrupted(self): | 110 def run_was_interrupted(self): |
| 111 return self._results["interrupted"] | 111 return self._results["interrupted"] |
| 112 | 112 |
| 113 def builder_name(self): | 113 def builder_name(self): |
| 114 return self._results["builder_name"] | 114 return self._results["builder_name"] |
| 115 | 115 |
| 116 @memoized | 116 @memoized |
| 117 def chromium_revision(self, scm=None): | 117 def chromium_revision(self, git=None): |
| 118 """Returns the revision of the results in commit position number format.
""" | 118 """Returns the revision of the results in commit position number format.
""" |
| 119 revision = self._chromium_revision or self._results["chromium_revision"] | 119 revision = self._chromium_revision or self._results["chromium_revision"] |
| 120 if not revision.isdigit(): | 120 if not revision.isdigit(): |
| 121 assert scm, "scm is required if the original revision is a git hash.
" | 121 assert git, "git is required if the original revision is a git hash.
" |
| 122 revision = scm.commit_position_from_git_commit(revision) | 122 revision = git.commit_position_from_git_commit(revision) |
| 123 return int(revision) | 123 return int(revision) |
| 124 | 124 |
| 125 def result_for_test(self, test): | 125 def result_for_test(self, test): |
| 126 parts = test.split("/") | 126 parts = test.split("/") |
| 127 tree = self._test_result_tree() | 127 tree = self._test_result_tree() |
| 128 for part in parts: | 128 for part in parts: |
| 129 if part not in tree: | 129 if part not in tree: |
| 130 return None | 130 return None |
| 131 tree = tree[part] | 131 tree = tree[part] |
| 132 return LayoutTestResult(test, tree) | 132 return LayoutTestResult(test, tree) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 153 def add_if_passes(result): | 153 def add_if_passes(result): |
| 154 if result_filter(result): | 154 if result_filter(result): |
| 155 results.append(result) | 155 results.append(result) |
| 156 | 156 |
| 157 LayoutTestResults._for_each_test(self._test_result_tree(), add_if_passes
) | 157 LayoutTestResults._for_each_test(self._test_result_tree(), add_if_passes
) |
| 158 return sorted(results, key=lambda r: r.test_name()) | 158 return sorted(results, key=lambda r: r.test_name()) |
| 159 | 159 |
| 160 def didnt_run_as_expected_results(self): | 160 def didnt_run_as_expected_results(self): |
| 161 # TODO(qyearsley): Rename this method. | 161 # TODO(qyearsley): Rename this method. |
| 162 return self._filter_tests(lambda r: not r.did_run_as_expected()) | 162 return self._filter_tests(lambda r: not r.did_run_as_expected()) |
| OLD | NEW |