| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 mock | 5 import mock |
| 6 | 6 |
| 7 from common import constants | 7 from common import constants |
| 8 from common.pipeline_wrapper import pipeline_handlers | 8 from common.pipeline_wrapper import pipeline_handlers |
| 9 from model import analysis_status | 9 from model import analysis_status |
| 10 from model.flake.master_flake_analysis import MasterFlakeAnalysis | 10 from model.flake.master_flake_analysis import MasterFlakeAnalysis |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 ScheduleAnalysisIfNeeded( | 116 ScheduleAnalysisIfNeeded( |
| 117 master_name, builder_name, build_number, | 117 master_name, builder_name, build_number, |
| 118 step_name, test_name, allow_new_analysis=True, | 118 step_name, test_name, allow_new_analysis=True, |
| 119 queue_name=constants.DEFAULT_QUEUE) | 119 queue_name=constants.DEFAULT_QUEUE) |
| 120 | 120 |
| 121 analysis = MasterFlakeAnalysis.GetVersion( | 121 analysis = MasterFlakeAnalysis.GetVersion( |
| 122 master_name, builder_name, build_number, step_name, test_name) | 122 master_name, builder_name, build_number, step_name, test_name) |
| 123 self.assertIsNotNone(analysis) | 123 self.assertIsNotNone(analysis) |
| 124 mocked_pipeline.assert_has_calls( | 124 mocked_pipeline.assert_has_calls( |
| 125 [mock.call().start(queue_name=constants.DEFAULT_QUEUE)]) | 125 [mock.call().StartOffPSTPeakHours(queue_name=constants.DEFAULT_QUEUE)]) |
| 126 | 126 |
| 127 @mock.patch( | 127 @mock.patch( |
| 128 'waterfall.flake.recursive_flake_pipeline.RecursiveFlakePipeline') | 128 'waterfall.flake.recursive_flake_pipeline.RecursiveFlakePipeline') |
| 129 def testNotStartPipelineForNewAnalysis(self, mocked_pipeline): | 129 def testNotStartPipelineForNewAnalysis(self, mocked_pipeline): |
| 130 master_name = 'm' | 130 master_name = 'm' |
| 131 builder_name = 'b' | 131 builder_name = 'b' |
| 132 build_number = 124 | 132 build_number = 124 |
| 133 step_name = 's' | 133 step_name = 's' |
| 134 test_name = 't' | 134 test_name = 't' |
| 135 | 135 |
| 136 self._CreateAndSaveMasterFlakeAnalysis( | 136 self._CreateAndSaveMasterFlakeAnalysis( |
| 137 master_name, builder_name, build_number, step_name, test_name, | 137 master_name, builder_name, build_number, step_name, test_name, |
| 138 status=analysis_status.COMPLETED) | 138 status=analysis_status.COMPLETED) |
| 139 | 139 |
| 140 ScheduleAnalysisIfNeeded( | 140 ScheduleAnalysisIfNeeded( |
| 141 master_name, builder_name, build_number, | 141 master_name, builder_name, build_number, |
| 142 step_name, test_name, | 142 step_name, test_name, |
| 143 queue_name=constants.DEFAULT_QUEUE) | 143 queue_name=constants.DEFAULT_QUEUE) |
| 144 | 144 |
| 145 self.assertFalse(mocked_pipeline.called) | 145 self.assertFalse(mocked_pipeline.called) |
| OLD | NEW |