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

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

Issue 2776543003: Change rebaseline-test-internal to take port name option. (Closed)
Patch Set: Add example port name and builder in help strings 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 port.host.filesystem.join(port.layout_tests_dir(), 'fast/dom/prototy pe-taco.html'), 265 port.host.filesystem.join(port.layout_tests_dir(), 'fast/dom/prototy pe-taco.html'),
266 'test contents') 266 'test contents')
267 test_baseline_set = TestBaselineSet(self.tool) 267 test_baseline_set = TestBaselineSet(self.tool)
268 test_baseline_set.add('fast/dom/prototype-taco.html', Build('MOCK Try Wi n', 5000)) 268 test_baseline_set.add('fast/dom/prototype-taco.html', Build('MOCK Try Wi n', 5000))
269 269
270 self.command.rebaseline(self.command_options(), test_baseline_set) 270 self.command.rebaseline(self.command_options(), test_baseline_set)
271 271
272 self.assertEqual( 272 self.assertEqual(
273 self.tool.executive.calls, 273 self.tool.executive.calls,
274 [ 274 [
275 [['python', 'echo', 'copy-existing-baselines-internal', '--suffi xes', 'txt', 275 [[
276 '--builder', 'MOCK Try Win', '--test', 'fast/dom/prototype-tac o.html']], 276 'python', 'echo', 'copy-existing-baselines-internal',
277 [['python', 'echo', 'rebaseline-test-internal', '--suffixes', 't xt', 277 '--test', 'fast/dom/prototype-taco.html',
278 '--builder', 'MOCK Try Win', '--test', 'fast/dom/prototype-tac o.html', '--build-number', '5000']], 278 '--suffixes', 'txt',
279 [['python', 'echo', 'optimize-baselines', '--suffixes', 'txt', ' fast/dom/prototype-taco.html']] 279 '--port-name', 'test-win-win7',
280 ]],
281 [[
282 'python', 'echo', 'rebaseline-test-internal',
283 '--test', 'fast/dom/prototype-taco.html',
284 '--suffixes', 'txt',
285 '--port-name', 'test-win-win7',
286 '--builder', 'MOCK Try Win',
287 '--build-number', '5000',
288 ]],
289 [[
290 'python', 'echo', 'optimize-baselines',
291 '--suffixes', 'txt',
292 'fast/dom/prototype-taco.html',
293 ]]
280 ]) 294 ])
281 295
282 def test_trigger_builds(self): 296 def test_trigger_builds(self):
283 # The trigger_builds method just uses git cl to trigger jobs for the giv en builders. 297 # The trigger_builds method just uses git cl to trigger jobs for the giv en builders.
284 self.command.trigger_builds(['MOCK Try Linux', 'MOCK Try Win']) 298 self.command.trigger_builds(['MOCK Try Linux', 'MOCK Try Win'])
285 self.assertEqual( 299 self.assertEqual(
286 self.tool.executive.calls, 300 self.tool.executive.calls,
287 [['git', 'cl', 'try', '-m', 'tryserver.blink', '-b', 'MOCK Try Linux ', '-b', 'MOCK Try Win']]) 301 [['git', 'cl', 'try', '-m', 'tryserver.blink', '-b', 'MOCK Try Linux ', '-b', 'MOCK Try Win']])
288 self.assertLog([ 302 self.assertLog([
289 'INFO: Triggering try jobs for:\n', 303 'INFO: Triggering try jobs for:\n',
(...skipping 28 matching lines...) Expand all
318 332
319 def test_bails_when_there_are_unstaged_baselines(self): 333 def test_bails_when_there_are_unstaged_baselines(self):
320 git = self.tool.git() 334 git = self.tool.git()
321 git.unstaged_changes = lambda: {'third_party/WebKit/LayoutTests/my-test- expected.txt': '?'} 335 git.unstaged_changes = lambda: {'third_party/WebKit/LayoutTests/my-test- expected.txt': '?'}
322 return_code = self.command.execute(self.command_options(), [], self.tool ) 336 return_code = self.command.execute(self.command_options(), [], self.tool )
323 self.assertEqual(return_code, 1) 337 self.assertEqual(return_code, 1)
324 self.assertLog([ 338 self.assertLog([
325 'ERROR: Aborting: there are unstaged baselines:\n', 339 'ERROR: Aborting: there are unstaged baselines:\n',
326 'ERROR: /mock-checkout/third_party/WebKit/LayoutTests/my-test-expe cted.txt\n', 340 'ERROR: /mock-checkout/third_party/WebKit/LayoutTests/my-test-expe cted.txt\n',
327 ]) 341 ])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698