| 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 import os | 5 import os |
| 6 | 6 |
| 7 from common import constants | 7 from common import constants |
| 8 from common import chromium_deps | 8 from common import chromium_deps |
| 9 from common.pipeline_wrapper import pipeline_handlers | 9 from common.pipeline_wrapper import pipeline_handlers |
| 10 from common.waterfall import failure_type |
| 10 from model import analysis_status | 11 from model import analysis_status |
| 11 from model.wf_analysis import WfAnalysis | 12 from model.wf_analysis import WfAnalysis |
| 12 from waterfall import analyze_build_failure_pipeline | 13 from waterfall import analyze_build_failure_pipeline |
| 13 from waterfall import buildbot | 14 from waterfall import buildbot |
| 14 from waterfall import lock_util | 15 from waterfall import lock_util |
| 15 from waterfall.analyze_build_failure_pipeline import AnalyzeBuildFailurePipeline | 16 from waterfall.analyze_build_failure_pipeline import AnalyzeBuildFailurePipeline |
| 16 from waterfall.test import wf_testcase | 17 from waterfall.test import wf_testcase |
| 17 | 18 |
| 18 | 19 |
| 19 class AnalyzeBuildFailurePipelineTest(wf_testcase.WaterfallTestCase): | 20 class AnalyzeBuildFailurePipelineTest(wf_testcase.WaterfallTestCase): |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 self.MockPipeline(analyze_build_failure_pipeline.IdentifyCulpritPipeline, | 52 self.MockPipeline(analyze_build_failure_pipeline.IdentifyCulpritPipeline, |
| 52 'heuristic_result', | 53 'heuristic_result', |
| 53 expected_args=[ | 54 expected_args=[ |
| 54 'failure_info', 'change_logs', 'deps_info', | 55 'failure_info', 'change_logs', 'deps_info', |
| 55 'signals', False], | 56 'signals', False], |
| 56 expected_kwargs={}) | 57 expected_kwargs={}) |
| 57 self.MockPipeline( | 58 self.MockPipeline( |
| 58 analyze_build_failure_pipeline.TriggerSwarmingTasksPipeline, | 59 analyze_build_failure_pipeline.TriggerSwarmingTasksPipeline, |
| 59 None, | 60 None, |
| 60 expected_args=[ | 61 expected_args=[ |
| 61 master_name, builder_name, build_number, | 62 master_name, builder_name, build_number, 'failure_info'], |
| 62 'failure_info'], | |
| 63 expected_kwargs={}) | 63 expected_kwargs={}) |
| 64 self.MockPipeline( | 64 self.MockPipeline( |
| 65 analyze_build_failure_pipeline.StartTryJobOnDemandPipeline, | 65 analyze_build_failure_pipeline.StartTryJobOnDemandPipeline, |
| 66 None, | 66 'try_job_result', |
| 67 expected_args=[ | 67 expected_args=[ |
| 68 'failure_info', 'signals', False, True, | 68 master_name, builder_name, build_number, 'failure_info', 'signals', |
| 69 'heuristic_result'], | 69 'heuristic_result', False, False], |
| 70 expected_kwargs={}) | 70 expected_kwargs={}) |
| 71 | 71 |
| 72 root_pipeline = AnalyzeBuildFailurePipeline(master_name, | 72 root_pipeline = AnalyzeBuildFailurePipeline(master_name, |
| 73 builder_name, | 73 builder_name, |
| 74 build_number, | 74 build_number, |
| 75 False, | 75 False, |
| 76 True) | 76 False) |
| 77 root_pipeline.start(queue_name=constants.DEFAULT_QUEUE) | 77 root_pipeline.start(queue_name=constants.DEFAULT_QUEUE) |
| 78 self.execute_queued_tasks() | 78 self.execute_queued_tasks() |
| 79 | 79 |
| 80 def testBuildFailurePipelineStartWithNoneResultStatus(self): | 80 def testBuildFailurePipelineStartWithNoneResultStatus(self): |
| 81 master_name = 'm' | 81 master_name = 'm' |
| 82 builder_name = 'b' | 82 builder_name = 'b' |
| 83 build_number = 124 | 83 build_number = 124 |
| 84 | 84 |
| 85 self._Setup(master_name, builder_name, build_number) | 85 self._Setup(master_name, builder_name, build_number) |
| 86 | 86 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 root_pipeline = AnalyzeBuildFailurePipeline(master_name, | 126 root_pipeline = AnalyzeBuildFailurePipeline(master_name, |
| 127 builder_name, | 127 builder_name, |
| 128 build_number, | 128 build_number, |
| 129 False, | 129 False, |
| 130 False) | 130 False) |
| 131 root_pipeline._LogUnexpectedAborting(True) | 131 root_pipeline._LogUnexpectedAborting(True) |
| 132 | 132 |
| 133 analysis = WfAnalysis.Get(master_name, builder_name, build_number) | 133 analysis = WfAnalysis.Get(master_name, builder_name, build_number) |
| 134 self.assertIsNotNone(analysis) | 134 self.assertIsNotNone(analysis) |
| 135 self.assertNotEqual(analysis_status.ERROR, analysis.status) | 135 self.assertNotEqual(analysis_status.ERROR, analysis.status) |
| OLD | NEW |