| 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.waterfall import failure_type | 7 from common.waterfall import failure_type |
| 8 from libs.gitiles.gitiles_repository import GitilesRepository | 8 from libs.gitiles.gitiles_repository import GitilesRepository |
| 9 from model import analysis_approach_type | 9 from model import analysis_approach_type |
| 10 from model import analysis_status | 10 from model import analysis_status |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 analysis = WfAnalysis.Create('m', 'b', 1) | 303 analysis = WfAnalysis.Create('m', 'b', 1) |
| 304 analysis.suspected_cls = [suspected_cl] | 304 analysis.suspected_cls = [suspected_cl] |
| 305 analysis.put() | 305 analysis.put() |
| 306 | 306 |
| 307 try_job_suspected_cls = { | 307 try_job_suspected_cls = { |
| 308 'rev1': suspected_cl | 308 'rev1': suspected_cl |
| 309 } | 309 } |
| 310 | 310 |
| 311 updated_cls = identify_try_job_culprit_pipeline._GetSuspectedCLs( | 311 updated_cls = identify_try_job_culprit_pipeline._GetSuspectedCLs( |
| 312 analysis, failure_type.TEST, None, try_job_suspected_cls) | 312 analysis, failure_type.TEST, None, try_job_suspected_cls) |
| 313 |
| 313 self.assertEqual(updated_cls, [suspected_cl]) | 314 self.assertEqual(updated_cls, [suspected_cl]) |
| 314 | 315 |
| 315 def testGetSuspectedCLsForTestTryJob(self): | 316 def testGetSuspectedCLsForTestTryJob(self): |
| 316 suspected_cl1 = { | 317 suspected_cl1 = { |
| 317 'revision': 'rev1', | 318 'revision': 'rev1', |
| 318 'commit_position': 1, | 319 'commit_position': 1, |
| 319 'url': 'url_1', | 320 'url': 'url_1', |
| 320 'repo_name': 'chromium' | 321 'repo_name': 'chromium' |
| 321 } | 322 } |
| 322 suspected_cl2 = { | 323 suspected_cl2 = { |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1198 | 1199 |
| 1199 identify_try_job_culprit_pipeline._NotifyCulprits( | 1200 identify_try_job_culprit_pipeline._NotifyCulprits( |
| 1200 master_name, builder_name, build_number, None, | 1201 master_name, builder_name, build_number, None, |
| 1201 heuristic_cls, compile_suspected_cl) | 1202 heuristic_cls, compile_suspected_cl) |
| 1202 self.assertEqual(1, len(instances)) | 1203 self.assertEqual(1, len(instances)) |
| 1203 self.assertTrue(instances[0].started) | 1204 self.assertTrue(instances[0].started) |
| 1204 | 1205 |
| 1205 def testGetTestFailureCausedByCLResultNone(self): | 1206 def testGetTestFailureCausedByCLResultNone(self): |
| 1206 self.assertIsNone( | 1207 self.assertIsNone( |
| 1207 identify_try_job_culprit_pipeline._GetTestFailureCausedByCL(None)) | 1208 identify_try_job_culprit_pipeline._GetTestFailureCausedByCL(None)) |
| OLD | NEW |