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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl_unittest.py

Issue 2740103008: Change rebaseline-cl and wpt-import to add master name when triggering jobs. (Closed)
Patch Set: git cl try Created 3 years, 9 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 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 self.assertEqual( 255 self.assertEqual(
256 self.tool.executive.calls, 256 self.tool.executive.calls,
257 [ 257 [
258 [ 258 [
259 'python', 259 'python',
260 '/mock-checkout/third_party/WebKit/Tools/Scripts/webkitpy/th irdparty/wpt/wpt/manifest', 260 '/mock-checkout/third_party/WebKit/Tools/Scripts/webkitpy/th irdparty/wpt/wpt/manifest',
261 '--work', 261 '--work',
262 '--tests-root', 262 '--tests-root',
263 '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt' 263 '/mock-checkout/third_party/WebKit/LayoutTests/external/wpt'
264 ], 264 ],
265 ['git', 'cl', 'try', '-b', 'MOCK Try Linux'] 265 ['git', 'cl', 'try', '-m', 'tryserver.blink', '-b', 'MOCK Try Li nux']
266 ]) 266 ])
267 267
268 def test_rebaseline_calls(self): 268 def test_rebaseline_calls(self):
269 """Tests the list of commands that are invoked when rebaseline is called .""" 269 """Tests the list of commands that are invoked when rebaseline is called ."""
270 # First write test contents to the mock filesystem so that 270 # First write test contents to the mock filesystem so that
271 # fast/dom/prototype-taco.html is considered a real test to rebaseline. 271 # fast/dom/prototype-taco.html is considered a real test to rebaseline.
272 port = self.tool.port_factory.get('test-win-win7') 272 port = self.tool.port_factory.get('test-win-win7')
273 self._write( 273 self._write(
274 port.host.filesystem.join(port.layout_tests_dir(), 'fast/dom/prototy pe-taco.html'), 274 port.host.filesystem.join(port.layout_tests_dir(), 'fast/dom/prototy pe-taco.html'),
275 'test contents') 275 'test contents')
(...skipping 10 matching lines...) Expand all
286 [['python', 'echo', 'rebaseline-test-internal', '--suffixes', 't xt', 286 [['python', 'echo', 'rebaseline-test-internal', '--suffixes', 't xt',
287 '--builder', 'MOCK Try Win', '--test', 'fast/dom/prototype-tac o.html', '--build-number', '5000']], 287 '--builder', 'MOCK Try Win', '--test', 'fast/dom/prototype-tac o.html', '--build-number', '5000']],
288 [['python', 'echo', 'optimize-baselines', '--suffixes', 'txt', ' fast/dom/prototype-taco.html']] 288 [['python', 'echo', 'optimize-baselines', '--suffixes', 'txt', ' fast/dom/prototype-taco.html']]
289 ]) 289 ])
290 290
291 def test_trigger_builds(self): 291 def test_trigger_builds(self):
292 # The trigger_builds method just uses git cl to trigger jobs for the giv en builders. 292 # The trigger_builds method just uses git cl to trigger jobs for the giv en builders.
293 self.command.trigger_builds(['MOCK Try Linux', 'MOCK Try Win']) 293 self.command.trigger_builds(['MOCK Try Linux', 'MOCK Try Win'])
294 self.assertEqual( 294 self.assertEqual(
295 self.tool.executive.calls, 295 self.tool.executive.calls,
296 [['git', 'cl', 'try', '-b', 'MOCK Try Linux', '-b', 'MOCK Try Win']] ) 296 [['git', 'cl', 'try', '-m', 'tryserver.blink', '-b', 'MOCK Try Linux ', '-b', 'MOCK Try Win']])
297 self.assertLog([ 297 self.assertLog([
298 'INFO: Triggering try jobs for:\n', 298 'INFO: Triggering try jobs for:\n',
299 'INFO: MOCK Try Linux\n', 299 'INFO: MOCK Try Linux\n',
300 'INFO: MOCK Try Win\n', 300 'INFO: MOCK Try Win\n',
301 ]) 301 ])
302 302
303 def test_builders_with_pending_builds(self): 303 def test_builders_with_pending_builds(self):
304 # A build number of None implies that a job has been started but not fin ished yet. 304 # A build number of None implies that a job has been started but not fin ished yet.
305 self.assertEqual( 305 self.assertEqual(
306 self.command.builders_with_pending_builds([Build('MOCK Try Linux', N one), Build('MOCK Try Win', 123)]), 306 self.command.builders_with_pending_builds([Build('MOCK Try Linux', N one), Build('MOCK Try Win', 123)]),
(...skipping 12 matching lines...) Expand all
319 319
320 def test_bails_when_there_are_unstaged_baselines(self): 320 def test_bails_when_there_are_unstaged_baselines(self):
321 git = self.tool.git() 321 git = self.tool.git()
322 git.unstaged_changes = lambda: {'third_party/WebKit/LayoutTests/my-test- expected.txt': '?'} 322 git.unstaged_changes = lambda: {'third_party/WebKit/LayoutTests/my-test- expected.txt': '?'}
323 return_code = self.command.execute(self.command_options(), [], self.tool ) 323 return_code = self.command.execute(self.command_options(), [], self.tool )
324 self.assertEqual(return_code, 1) 324 self.assertEqual(return_code, 1)
325 self.assertLog([ 325 self.assertLog([
326 'ERROR: Aborting: there are unstaged baselines:\n', 326 'ERROR: Aborting: there are unstaged baselines:\n',
327 'ERROR: /mock-checkout/third_party/WebKit/LayoutTests/my-test-expe cted.txt\n', 327 'ERROR: /mock-checkout/third_party/WebKit/LayoutTests/my-test-expe cted.txt\n',
328 ]) 328 ])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698