| 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 json | 5 import json |
| 6 import optparse | 6 import optparse |
| 7 | 7 |
| 8 from webkitpy.common.net.buildbot import Build | 8 from webkitpy.common.net.buildbot import Build |
| 9 from webkitpy.common.net.rietveld import Rietveld | 9 from webkitpy.common.net.rietveld import Rietveld |
| 10 from webkitpy.common.net.web_mock import MockWeb | 10 from webkitpy.common.net.web_mock import MockWeb |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 [['python', 'echo', 'rebaseline-test-internal', '--suffixes', 't
xt', | 177 [['python', 'echo', 'rebaseline-test-internal', '--suffixes', 't
xt', |
| 178 '--builder', 'MOCK Try Win', '--test', 'fast/dom/prototype-tac
o.html', '--build-number', '5000']], | 178 '--builder', 'MOCK Try Win', '--test', 'fast/dom/prototype-tac
o.html', '--build-number', '5000']], |
| 179 [['python', 'echo', 'optimize-baselines', '--suffixes', 'txt', '
fast/dom/prototype-taco.html']] | 179 [['python', 'echo', 'optimize-baselines', '--suffixes', 'txt', '
fast/dom/prototype-taco.html']] |
| 180 ]) | 180 ]) |
| 181 | 181 |
| 182 def test_trigger_jobs_for_missing_builds_empty_list(self): | 182 def test_trigger_jobs_for_missing_builds_empty_list(self): |
| 183 # Passing in no builds implies that no try jobs were started. | 183 # Passing in no builds implies that no try jobs were started. |
| 184 self.assertTrue(self.command.trigger_jobs_for_missing_builds([])) | 184 self.assertTrue(self.command.trigger_jobs_for_missing_builds([])) |
| 185 self.assertEqual( | 185 self.assertEqual( |
| 186 self.tool.executive.calls, | 186 self.tool.executive.calls, |
| 187 [['git', 'cl', 'try', '-b', 'MOCK Try Linux'], ['git', 'cl', 'try',
'-b', 'MOCK Try Win']]) | 187 [['git', 'cl', 'try', '-b', 'MOCK Try Linux', '-b', 'MOCK Try Win']]
) |
| 188 self.assertLog([ | 188 self.assertLog([ |
| 189 'INFO: Triggering try jobs for:\n', | 189 'INFO: Triggering try jobs for:\n', |
| 190 'INFO: MOCK Try Linux\n', | 190 'INFO: MOCK Try Linux\n', |
| 191 'INFO: MOCK Try Win\n', | 191 'INFO: MOCK Try Win\n', |
| 192 ]) | 192 ]) |
| 193 | 193 |
| 194 def test_trigger_jobs_for_missing_builds_started_and_successful(self): | 194 def test_trigger_jobs_for_missing_builds_started_and_successful(self): |
| 195 # A build number of None implies that a job has been started but not fin
ished yet. | 195 # A build number of None implies that a job has been started but not fin
ished yet. |
| 196 self.assertTrue(self.command.trigger_jobs_for_missing_builds([ | 196 self.assertTrue(self.command.trigger_jobs_for_missing_builds([ |
| 197 Build('MOCK Try Linux', None), | 197 Build('MOCK Try Linux', None), |
| 198 Build('MOCK Try Win', 123), | 198 Build('MOCK Try Win', 123), |
| 199 ])) | 199 ])) |
| 200 self.assertEqual(self.tool.executive.calls, []) | 200 self.assertEqual(self.tool.executive.calls, []) |
| 201 self.assertLog([ | 201 self.assertLog([ |
| 202 'INFO: There are existing pending builds for:\n', | 202 'INFO: There are existing pending builds for:\n', |
| 203 'INFO: MOCK Try Linux\n', | 203 'INFO: MOCK Try Linux\n', |
| 204 ]) | 204 ]) |
| 205 | 205 |
| 206 def test_trigger_jobs_for_missing_builds_one_started(self): | 206 def test_trigger_jobs_for_missing_builds_one_started(self): |
| 207 self.assertTrue(self.command.trigger_jobs_for_missing_builds([ | 207 self.assertTrue(self.command.trigger_jobs_for_missing_builds([ |
| 208 Build('MOCK Try Linux', None), | 208 Build('MOCK Try Linux', None), |
| 209 ])) | 209 ])) |
| 210 self.assertEqual(self.tool.executive.calls, [['git', 'cl', 'try', '-b',
'MOCK Try Win']]) | 210 self.assertEqual(self.tool.executive.calls, [['git', 'cl', 'try', '-b',
'MOCK Try Win']]) |
| 211 self.assertLog([ | 211 self.assertLog([ |
| 212 'INFO: There are existing pending builds for:\n', | 212 'INFO: There are existing pending builds for:\n', |
| 213 'INFO: MOCK Try Linux\n', | 213 'INFO: MOCK Try Linux\n', |
| 214 'INFO: Triggering try jobs for:\n', | 214 'INFO: Triggering try jobs for:\n', |
| 215 'INFO: MOCK Try Win\n', | 215 'INFO: MOCK Try Win\n', |
| 216 ]) | 216 ]) |
| OLD | NEW |