| 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.git_cl import GitCL | 9 from webkitpy.common.net.git_cl import GitCL |
| 10 from webkitpy.common.checkout.git_mock import MockGit | 10 from webkitpy.common.checkout.git_mock import MockGit |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 def test_execute_with_trigger_jobs_option(self): | 221 def test_execute_with_trigger_jobs_option(self): |
| 222 return_code = self.command.execute(self.command_options(trigger_jobs=Tru
e), [], self.tool) | 222 return_code = self.command.execute(self.command_options(trigger_jobs=Tru
e), [], self.tool) |
| 223 self.assertEqual(return_code, 1) | 223 self.assertEqual(return_code, 1) |
| 224 self.assertLog([ | 224 self.assertLog([ |
| 225 'INFO: Triggering try jobs for:\n', | 225 'INFO: Triggering try jobs for:\n', |
| 226 'INFO: MOCK Try Linux\n', | 226 'INFO: MOCK Try Linux\n', |
| 227 'INFO: Please re-run webkit-patch rebaseline-cl once all pending try
jobs have finished.\n', | 227 'INFO: Please re-run webkit-patch rebaseline-cl once all pending try
jobs have finished.\n', |
| 228 ]) | 228 ]) |
| 229 self.assertEqual( | 229 self.assertEqual( |
| 230 self.tool.executive.calls, | 230 self.tool.executive.calls, |
| 231 [['git', 'cl', 'try', '-b', 'MOCK Try Linux']]) | 231 [ |
| 232 [ |
| 233 'python', |
| 234 '/mock-checkout/third_party/WebKit/Tools/Scripts/webkitpy/th
irdparty/wpt/wpt/manifest', |
| 235 '--work', |
| 236 '--tests-root', |
| 237 '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt' |
| 238 ], |
| 239 ['git', 'cl', 'try', '-b', 'MOCK Try Linux'] |
| 240 ]) |
| 232 | 241 |
| 233 def test_rebaseline_calls(self): | 242 def test_rebaseline_calls(self): |
| 234 """Tests the list of commands that are invoked when rebaseline is called
.""" | 243 """Tests the list of commands that are invoked when rebaseline is called
.""" |
| 235 # First write test contents to the mock filesystem so that | 244 # First write test contents to the mock filesystem so that |
| 236 # fast/dom/prototype-taco.html is considered a real test to rebaseline. | 245 # fast/dom/prototype-taco.html is considered a real test to rebaseline. |
| 237 port = self.tool.port_factory.get('test-win-win7') | 246 port = self.tool.port_factory.get('test-win-win7') |
| 238 self._write( | 247 self._write( |
| 239 port.host.filesystem.join(port.layout_tests_dir(), 'fast/dom/prototy
pe-taco.html'), | 248 port.host.filesystem.join(port.layout_tests_dir(), 'fast/dom/prototy
pe-taco.html'), |
| 240 'test contents') | 249 'test contents') |
| 241 | 250 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 | 311 |
| 303 def test_bails_when_there_are_unstaged_baselines(self): | 312 def test_bails_when_there_are_unstaged_baselines(self): |
| 304 git = self.tool.git() | 313 git = self.tool.git() |
| 305 git.unstaged_changes = lambda: {'third_party/WebKit/LayoutTests/my-test-
expected.txt': '?'} | 314 git.unstaged_changes = lambda: {'third_party/WebKit/LayoutTests/my-test-
expected.txt': '?'} |
| 306 return_code = self.command.execute(self.command_options(), [], self.tool
) | 315 return_code = self.command.execute(self.command_options(), [], self.tool
) |
| 307 self.assertEqual(return_code, 1) | 316 self.assertEqual(return_code, 1) |
| 308 self.assertLog([ | 317 self.assertLog([ |
| 309 'ERROR: Aborting: there are unstaged baselines:\n', | 318 'ERROR: Aborting: there are unstaged baselines:\n', |
| 310 'ERROR: /mock-checkout/third_party/WebKit/LayoutTests/my-test-expe
cted.txt\n', | 319 'ERROR: /mock-checkout/third_party/WebKit/LayoutTests/my-test-expe
cted.txt\n', |
| 311 ]) | 320 ]) |
| OLD | NEW |