| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 from testing_utils import testing | 5 from testing_utils import testing |
| 6 | 6 |
| 7 from common.git_repository import GitRepository | 7 from common.git_repository import GitRepository |
| 8 from model import wf_analysis_status | 8 from model import wf_analysis_status |
| 9 from model.wf_try_job import WfTryJob | 9 from model.wf_try_job import WfTryJob |
| 10 from waterfall.identify_try_job_culprit_pipeline import( | 10 from waterfall.identify_try_job_culprit_pipeline import( |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 TryJobType.COMPILE, '1', compile_result) | 131 TryJobType.COMPILE, '1', compile_result) |
| 132 expected_compile_result = { | 132 expected_compile_result = { |
| 133 'report': { | 133 'report': { |
| 134 'result': { | 134 'result': { |
| 135 'rev1': 'passed', | 135 'rev1': 'passed', |
| 136 'rev2': 'failed' | 136 'rev2': 'failed' |
| 137 } | 137 } |
| 138 }, | 138 }, |
| 139 'try_job_id': '1', | 139 'try_job_id': '1', |
| 140 'culprit': { | 140 'culprit': { |
| 141 'revision': 'rev2', | 141 'compile': { |
| 142 'commit_position': '2', | 142 'revision': 'rev2', |
| 143 'review_url': 'url_2' | 143 'commit_position': '2', |
| 144 'review_url': 'url_2' |
| 145 } |
| 144 } | 146 } |
| 145 } | 147 } |
| 146 | 148 |
| 147 self.assertEqual(expected_compile_result['culprit'], culprit) | 149 self.assertEqual(expected_compile_result['culprit'], culprit) |
| 148 | 150 |
| 149 try_job = WfTryJob.Get(master_name, builder_name, build_number) | 151 try_job = WfTryJob.Get(master_name, builder_name, build_number) |
| 150 | 152 |
| 151 self.assertEqual(expected_compile_result, try_job.compile_results[-1]) | 153 self.assertEqual(expected_compile_result, try_job.compile_results[-1]) |
| 152 self.assertEqual(wf_analysis_status.ANALYZED, try_job.status) | 154 self.assertEqual(wf_analysis_status.ANALYZED, try_job.status) |
| 153 | 155 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 expected_compile_result = { | 210 expected_compile_result = { |
| 209 'report': { | 211 'report': { |
| 210 'result': { | 212 'result': { |
| 211 'rev1': 'passed', | 213 'rev1': 'passed', |
| 212 'rev2': 'failed' | 214 'rev2': 'failed' |
| 213 } | 215 } |
| 214 }, | 216 }, |
| 215 'url': 'url', | 217 'url': 'url', |
| 216 'try_job_id': '1', | 218 'try_job_id': '1', |
| 217 'culprit': { | 219 'culprit': { |
| 218 'revision': 'rev2', | 220 'compile': { |
| 219 'commit_position': '2', | 221 'revision': 'rev2', |
| 220 'review_url': 'url_2' | 222 'commit_position': '2', |
| 223 'review_url': 'url_2' |
| 224 } |
| 221 } | 225 } |
| 222 } | 226 } |
| 223 | 227 |
| 224 self.assertEqual(expected_compile_result['culprit'], culprit) | 228 self.assertEqual(expected_compile_result['culprit'], culprit) |
| 225 | 229 |
| 226 try_job = WfTryJob.Get(master_name, builder_name, build_number) | 230 try_job = WfTryJob.Get(master_name, builder_name, build_number) |
| 227 self.assertEqual(expected_compile_result, try_job.compile_results[-1]) | 231 self.assertEqual(expected_compile_result, try_job.compile_results[-1]) |
| 228 self.assertEqual(wf_analysis_status.ANALYZED, try_job.status) | 232 self.assertEqual(wf_analysis_status.ANALYZED, try_job.status) |
| 229 | 233 |
| 230 def testIdentifyCulpritForTestTryJobReturnNoneIfNoTryJobResult(self): | 234 def testIdentifyCulpritForTestTryJobReturnNoneIfNoTryJobResult(self): |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 'tests': {} | 437 'tests': {} |
| 434 } | 438 } |
| 435 } | 439 } |
| 436 } | 440 } |
| 437 | 441 |
| 438 self.assertEqual(expected_test_result['culprit'], culprit) | 442 self.assertEqual(expected_test_result['culprit'], culprit) |
| 439 | 443 |
| 440 try_job = WfTryJob.Get(master_name, builder_name, build_number) | 444 try_job = WfTryJob.Get(master_name, builder_name, build_number) |
| 441 self.assertEqual(expected_test_result, try_job.test_results[-1]) | 445 self.assertEqual(expected_test_result, try_job.test_results[-1]) |
| 442 self.assertEqual(wf_analysis_status.ANALYZED, try_job.status) | 446 self.assertEqual(wf_analysis_status.ANALYZED, try_job.status) |
| OLD | NEW |