Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: appengine/findit/waterfall/flake/test/initialize_flake_pipeline_test.py

Issue 2376573004: [Findit] For automatic analyses of flaky tests, run the Swarming tasks off PST peak hours. (Closed)
Patch Set: Fix nit. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698