| 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 common.waterfall import failure_type | 5 from common.waterfall import failure_type |
| 6 from model import analysis_status | 6 from model import analysis_status |
| 7 from model.wf_try_job import WfTryJob | 7 from model.wf_try_job import WfTryJob |
| 8 from waterfall import try_job_util | 8 from waterfall import try_job_util |
| 9 from waterfall.test import wf_testcase | 9 from waterfall.test import wf_testcase |
| 10 from waterfall.try_job_type import TryJobType | 10 from waterfall.try_job_type import TryJobType |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 {'source': 'b.cc', 'target': 'b.o'}, | 416 {'source': 'b.cc', 'target': 'b.o'}, |
| 417 ] | 417 ] |
| 418 } | 418 } |
| 419 } | 419 } |
| 420 | 420 |
| 421 self.assertEqual( | 421 self.assertEqual( |
| 422 try_job_util._GetFailedTargetsFromSignals( | 422 try_job_util._GetFailedTargetsFromSignals( |
| 423 signals, 'master1', 'builder1'), | 423 signals, 'master1', 'builder1'), |
| 424 ['b.o']) | 424 ['b.o']) |
| 425 | 425 |
| 426 def testGetSuspectsForCompileFailureFromHeuristicResult(self): | 426 def testGetSuspectsFromHeuristicResultForCompile(self): |
| 427 heuristic_result = { | 427 heuristic_result = { |
| 428 'failures': [ | 428 'failures': [ |
| 429 { | 429 { |
| 430 'step_name': 'compile', | 430 'step_name': 'compile', |
| 431 'suspected_cls': [ | 431 'suspected_cls': [ |
| 432 { | 432 { |
| 433 'revision': 'r1', | 433 'revision': 'r1', |
| 434 }, | 434 }, |
| 435 { | 435 { |
| 436 'revision': 'r2', | 436 'revision': 'r2', |
| 437 }, | 437 }, |
| 438 ], | 438 ], |
| 439 }, | 439 }, |
| 440 { | |
| 441 'step_name': 'steps' | |
| 442 }, | |
| 443 ] | 440 ] |
| 444 } | 441 } |
| 445 expected_suspected_revisions = ['r1', 'r2'] | 442 expected_suspected_revisions = ['r1', 'r2'] |
| 446 self.assertEqual( | 443 self.assertEqual( |
| 447 expected_suspected_revisions, | 444 expected_suspected_revisions, |
| 448 try_job_util._GetSuspectsForCompileFailureFromHeuristicResult( | 445 try_job_util._GetSuspectsFromHeuristicResult(heuristic_result)) |
| 449 heuristic_result)) | 446 |
| 447 def testGetSuspectsFromHeuristicResultForTest(self): |
| 448 heuristic_result = { |
| 449 'failures': [ |
| 450 { |
| 451 'step_name': 'step1', |
| 452 'suspected_cls': [ |
| 453 { |
| 454 'revision': 'r1', |
| 455 }, |
| 456 { |
| 457 'revision': 'r2', |
| 458 }, |
| 459 ], |
| 460 }, |
| 461 { |
| 462 'step_name': 'step2', |
| 463 'suspected_cls': [ |
| 464 { |
| 465 'revision': 'r1', |
| 466 }, |
| 467 { |
| 468 'revision': 'r3', |
| 469 }, |
| 470 ], |
| 471 }, |
| 472 ] |
| 473 } |
| 474 expected_suspected_revisions = ['r1', 'r2', 'r3'] |
| 475 self.assertEqual( |
| 476 expected_suspected_revisions, |
| 477 try_job_util._GetSuspectsFromHeuristicResult(heuristic_result)) |
| OLD | NEW |