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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/auto_rebaseline_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
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/optimize_baselines.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 optparse 5 import optparse
6 6
7 from webkitpy.common.net.buildbot import Build 7 from webkitpy.common.net.buildbot import Build
8 from webkitpy.common.net.layout_test_results import LayoutTestResults 8 from webkitpy.common.net.layout_test_results import LayoutTestResults
9 from webkitpy.common.system.executive_mock import MockExecutive 9 from webkitpy.common.system.executive_mock import MockExecutive
10 from webkitpy.layout_tests.builder_list import BuilderList 10 from webkitpy.layout_tests.builder_list import BuilderList
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 self.command.tree_status = lambda: 'closed' 221 self.command.tree_status = lambda: 'closed'
222 self._execute_with_mock_options() 222 self._execute_with_mock_options()
223 self.assertEqual(self.tool.executive.calls, []) 223 self.assertEqual(self.tool.executive.calls, [])
224 224
225 self.command.tree_status = lambda: 'open' 225 self.command.tree_status = lambda: 'open'
226 self.tool.executive.calls = [] 226 self.tool.executive.calls = []
227 self._execute_with_mock_options() 227 self._execute_with_mock_options()
228 228
229 self.assertEqual(self.tool.executive.calls, [ 229 self.assertEqual(self.tool.executive.calls, [
230 [ 230 [
231 ['python', 'echo', 'copy-existing-baselines-internal', '--suffix es', 'png', 231 [
232 '--builder', 'MOCK Mac10.11', '--test', 'fast/dom/prototype-str awberry.html'], 232 'python', 'echo', 'copy-existing-baselines-internal',
233 ['python', 'echo', 'copy-existing-baselines-internal', '--suffix es', 'txt', 233 '--test', 'fast/dom/prototype-strawberry.html',
234 '--builder', 'MOCK Mac10.11', '--test', 'fast/dom/prototype-tac o.html'], 234 '--suffixes', 'png',
235 '--port-name', 'test-mac-mac10.11',
236 ],
237 [
238 'python', 'echo', 'copy-existing-baselines-internal',
239 '--test', 'fast/dom/prototype-taco.html',
240 '--suffixes', 'txt',
241 '--port-name', 'test-mac-mac10.11',
242 ],
235 ], 243 ],
236 [ 244 [
237 ['python', 'echo', 'rebaseline-test-internal', '--suffixes', 'pn g', 245 [
238 '--builder', 'MOCK Mac10.11', '--test', 'fast/dom/prototype-str awberry.html'], 246 'python', 'echo', 'rebaseline-test-internal',
239 ['python', 'echo', 'rebaseline-test-internal', '--suffixes', 'tx t', 247 '--test', 'fast/dom/prototype-strawberry.html',
240 '--builder', 'MOCK Mac10.11', '--test', 'fast/dom/prototype-tac o.html'], 248 '--suffixes', 'png',
249 '--port-name', 'test-mac-mac10.11',
250 '--builder', 'MOCK Mac10.11',
251 ],
252 [
253 'python', 'echo', 'rebaseline-test-internal',
254 '--test', 'fast/dom/prototype-taco.html',
255 '--suffixes', 'txt',
256 '--port-name', 'test-mac-mac10.11',
257 '--builder', 'MOCK Mac10.11',
258 ],
241 ], 259 ],
242 [ 260 [
243 ['python', 'echo', 'optimize-baselines', 261 [
244 '--suffixes', 'png', 'fast/dom/prototype-strawberry.html'], 262 'python', 'echo', 'optimize-baselines',
245 ['python', 'echo', 'optimize-baselines', 263 '--suffixes', 'png',
246 '--suffixes', 'txt', 'fast/dom/prototype-taco.html'], 264 'fast/dom/prototype-strawberry.html',
265 ],
266 [
267 'python', 'echo', 'optimize-baselines',
268 '--suffixes', 'txt',
269 'fast/dom/prototype-taco.html',
270 ],
247 ], 271 ],
248 ['git', 'cl', 'upload', '-f'], 272 ['git', 'cl', 'upload', '-f'],
249 ['git', 'pull'], 273 ['git', 'pull'],
250 ['git', 'cl', 'land', '-f', '-v'], 274 ['git', 'cl', 'land', '-f', '-v'],
251 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietveldi ssue'], 275 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietveldi ssue'],
252 ['git', 'cl', 'set_close'], 276 ['git', 'cl', 'set_close'],
253 ]) 277 ])
254 278
255 # The mac ports should both be removed since they're the only ones in bu ilders._exact_matches. 279 # The mac ports should both be removed since they're the only ones in bu ilders._exact_matches.
256 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_to_g eneric_test_expectations_file()), """ 280 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_to_g eneric_test_expectations_file()), """
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 'MOCK Mac10.11': {'port_name': 'test-mac-mac10.11', 'specifiers': [' Mac10.11', 'Release']}, 319 'MOCK Mac10.11': {'port_name': 'test-mac-mac10.11', 'specifiers': [' Mac10.11', 'Release']},
296 }) 320 })
297 321
298 self.command.SECONDS_BEFORE_GIVING_UP = 0 322 self.command.SECONDS_BEFORE_GIVING_UP = 0
299 self.command.tree_status = lambda: 'open' 323 self.command.tree_status = lambda: 'open'
300 self.tool.executive = MockExecutive() 324 self.tool.executive = MockExecutive()
301 self.tool.executive.calls = [] 325 self.tool.executive.calls = []
302 self._execute_with_mock_options() 326 self._execute_with_mock_options()
303 327
304 self.assertEqual(self.tool.executive.calls, [ 328 self.assertEqual(self.tool.executive.calls, [
305 [['python', 'echo', 'copy-existing-baselines-internal', '--suffixes' , 'txt', 329 [[
306 '--builder', 'MOCK Mac10.11', '--test', 'fast/dom/prototype-taco.h tml']], 330 'python', 'echo', 'copy-existing-baselines-internal',
307 [['python', 'echo', 'rebaseline-test-internal', '--suffixes', 'txt', 331 '--test', 'fast/dom/prototype-taco.html',
308 '--builder', 'MOCK Mac10.11', '--test', 'fast/dom/prototype-taco.h tml']], 332 '--suffixes', 'txt',
309 [['python', 'echo', 'optimize-baselines', '--suffixes', 'txt', 'fast /dom/prototype-taco.html']], 333 '--port-name', 'test-mac-mac10.11',
334 ]],
335 [[
336 'python', 'echo', 'rebaseline-test-internal',
337 '--test', 'fast/dom/prototype-taco.html',
338 '--suffixes', 'txt',
339 '--port-name', 'test-mac-mac10.11',
340 '--builder', 'MOCK Mac10.11',
341 ]],
342 [[
343 'python', 'echo', 'optimize-baselines',
344 '--suffixes', 'txt',
345 'fast/dom/prototype-taco.html',
346 ]],
310 ['git', 'cl', 'upload', '-f'], 347 ['git', 'cl', 'upload', '-f'],
311 ]) 348 ])
312 349
313 def test_execute_test_passes_everywhere(self): 350 def test_execute_test_passes_everywhere(self):
314 def blame(_): 351 def blame(_):
315 return """ 352 return """
316 6469e754a1 path/to/TestExpectations (<foobarbaz1@chromium.org> 2013-04-28 04:52:41 +0000 13) Bug(foo) fast/dom/prototype-taco.html [ NeedsRe baseline ] 353 6469e754a1 path/to/TestExpectations (<foobarbaz1@chromium.org> 2013-04-28 04:52:41 +0000 13) Bug(foo) fast/dom/prototype-taco.html [ NeedsRe baseline ]
317 """ 354 """
318 self.tool.git().blame = blame 355 self.tool.git().blame = blame
319 356
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 566
530 def test_execute_with_dry_run(self): 567 def test_execute_with_dry_run(self):
531 self._basic_execute_test([], dry_run=True) 568 self._basic_execute_test([], dry_run=True)
532 self.assertEqual(self.tool.git().local_commits(), []) 569 self.assertEqual(self.tool.git().local_commits(), [])
533 570
534 def test_bot_revision_data(self): 571 def test_bot_revision_data(self):
535 self._setup_mock_build_data() 572 self._setup_mock_build_data()
536 self.assertEqual( 573 self.assertEqual(
537 self.command.bot_revision_data(self.tool.git()), 574 self.command.bot_revision_data(self.tool.git()),
538 [{'builder': 'MOCK Win7', 'revision': '9000'}]) 575 [{'builder': 'MOCK Win7', 'revision': '9000'}])
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/optimize_baselines.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698