| 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 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 [ | 238 [ |
| 239 ['python', 'echo', 'optimize-baselines', | 239 ['python', 'echo', 'optimize-baselines', |
| 240 '--suffixes', 'png', 'fast/dom/prototype-strawberry.html'], | 240 '--suffixes', 'png', 'fast/dom/prototype-strawberry.html'], |
| 241 ['python', 'echo', 'optimize-baselines', | 241 ['python', 'echo', 'optimize-baselines', |
| 242 '--suffixes', 'txt', 'fast/dom/prototype-taco.html'], | 242 '--suffixes', 'txt', 'fast/dom/prototype-taco.html'], |
| 243 ], | 243 ], |
| 244 ['git', 'cl', 'upload', '-f'], | 244 ['git', 'cl', 'upload', '-f'], |
| 245 ['git', 'pull'], | 245 ['git', 'pull'], |
| 246 ['git', 'cl', 'land', '-f', '-v'], | 246 ['git', 'cl', 'land', '-f', '-v'], |
| 247 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietveldi
ssue'], | 247 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietveldi
ssue'], |
| 248 ['git', 'cl', 'set_close'], |
| 248 ]) | 249 ]) |
| 249 | 250 |
| 250 # The mac ports should both be removed since they're the only ones in bu
ilders._exact_matches. | 251 # The mac ports should both be removed since they're the only ones in bu
ilders._exact_matches. |
| 251 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_to_g
eneric_test_expectations_file()), """ | 252 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_to_g
eneric_test_expectations_file()), """ |
| 252 crbug.com/24182 [ Debug ] path/to/norebaseline.html [ Rebaseline ] | 253 crbug.com/24182 [ Debug ] path/to/norebaseline.html [ Rebaseline ] |
| 253 Bug(foo) [ Linux Win ] fast/dom/prototype-taco.html [ NeedsRebaseline ] | 254 Bug(foo) [ Linux Win ] fast/dom/prototype-taco.html [ NeedsRebaseline ] |
| 254 crbug.com/24182 [ Linux Win ] fast/dom/prototype-chocolate.html [ NeedsRebaselin
e ] | 255 crbug.com/24182 [ Linux Win ] fast/dom/prototype-chocolate.html [ NeedsRebaselin
e ] |
| 255 crbug.com/24182 path/to/not-cycled-through-bots.html [ NeedsRebaseline ] | 256 crbug.com/24182 path/to/not-cycled-through-bots.html [ NeedsRebaseline ] |
| 256 crbug.com/24182 path/to/locally-changed-lined.html [ NeedsRebaseline ] | 257 crbug.com/24182 path/to/locally-changed-lined.html [ NeedsRebaseline ] |
| 257 """) | 258 """) |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 "MOCK Mac10.11": {"port_name": "test-mac-mac10.11", "specifiers": ["
Mac10.11", "Release"]}, | 343 "MOCK Mac10.11": {"port_name": "test-mac-mac10.11", "specifiers": ["
Mac10.11", "Release"]}, |
| 343 }) | 344 }) |
| 344 | 345 |
| 345 self.command.tree_status = lambda: 'open' | 346 self.command.tree_status = lambda: 'open' |
| 346 self._execute_with_mock_options() | 347 self._execute_with_mock_options() |
| 347 self.assertEqual(self.tool.executive.calls, [ | 348 self.assertEqual(self.tool.executive.calls, [ |
| 348 ['git', 'cl', 'upload', '-f'], | 349 ['git', 'cl', 'upload', '-f'], |
| 349 ['git', 'pull'], | 350 ['git', 'pull'], |
| 350 ['git', 'cl', 'land', '-f', '-v'], | 351 ['git', 'cl', 'land', '-f', '-v'], |
| 351 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietveldi
ssue'], | 352 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietveldi
ssue'], |
| 353 ['git', 'cl', 'set_close'], |
| 352 ]) | 354 ]) |
| 353 | 355 |
| 354 # The mac ports should both be removed since they're the only ones in bu
ilders._exact_matches. | 356 # The mac ports should both be removed since they're the only ones in bu
ilders._exact_matches. |
| 355 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_to_g
eneric_test_expectations_file()), """ | 357 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_to_g
eneric_test_expectations_file()), """ |
| 356 Bug(foo) [ Linux Win ] fast/dom/prototype-taco.html [ NeedsRebaseline ] | 358 Bug(foo) [ Linux Win ] fast/dom/prototype-taco.html [ NeedsRebaseline ] |
| 357 """) | 359 """) |
| 358 | 360 |
| 359 def test_execute_use_alternate_rebaseline_branch(self): | 361 def test_execute_use_alternate_rebaseline_branch(self): |
| 360 def blame(_): | 362 def blame(_): |
| 361 return """ | 363 return """ |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 old_branch_name = self.tool.scm().current_branch_or_ref | 395 old_branch_name = self.tool.scm().current_branch_or_ref |
| 394 try: | 396 try: |
| 395 self.command.tree_status = lambda: 'open' | 397 self.command.tree_status = lambda: 'open' |
| 396 self.tool.scm().current_branch_or_ref = lambda: 'auto-rebaseline-tem
porary-branch' | 398 self.tool.scm().current_branch_or_ref = lambda: 'auto-rebaseline-tem
porary-branch' |
| 397 self._execute_with_mock_options() | 399 self._execute_with_mock_options() |
| 398 self.assertEqual(self.tool.executive.calls, [ | 400 self.assertEqual(self.tool.executive.calls, [ |
| 399 ['git', 'cl', 'upload', '-f'], | 401 ['git', 'cl', 'upload', '-f'], |
| 400 ['git', 'pull'], | 402 ['git', 'pull'], |
| 401 ['git', 'cl', 'land', '-f', '-v'], | 403 ['git', 'cl', 'land', '-f', '-v'], |
| 402 ['git', 'config', 'branch.auto-rebaseline-alt-temporary-branch.r
ietveldissue'], | 404 ['git', 'config', 'branch.auto-rebaseline-alt-temporary-branch.r
ietveldissue'], |
| 405 ['git', 'cl', 'set_close'], |
| 403 ]) | 406 ]) |
| 404 | 407 |
| 405 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_
to_generic_test_expectations_file()), """ | 408 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_
to_generic_test_expectations_file()), """ |
| 406 Bug(foo) [ Linux Mac Win10 ] fast/dom/prototype-taco.html [ NeedsRebaseline ] | 409 Bug(foo) [ Linux Mac Win10 ] fast/dom/prototype-taco.html [ NeedsRebaseline ] |
| 407 """) | 410 """) |
| 408 finally: | 411 finally: |
| 409 self.tool.scm().current_branch_or_ref = old_branch_name | 412 self.tool.scm().current_branch_or_ref = old_branch_name |
| 410 | 413 |
| 411 def test_execute_stuck_on_alternate_rebaseline_branch(self): | 414 def test_execute_stuck_on_alternate_rebaseline_branch(self): |
| 412 def blame(_): | 415 def blame(_): |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 old_branch_name = self.tool.scm().current_branch_or_ref | 448 old_branch_name = self.tool.scm().current_branch_or_ref |
| 446 try: | 449 try: |
| 447 self.command.tree_status = lambda: 'open' | 450 self.command.tree_status = lambda: 'open' |
| 448 self.tool.scm().current_branch_or_ref = lambda: 'auto-rebaseline-alt
-temporary-branch' | 451 self.tool.scm().current_branch_or_ref = lambda: 'auto-rebaseline-alt
-temporary-branch' |
| 449 self._execute_with_mock_options() | 452 self._execute_with_mock_options() |
| 450 self.assertEqual(self.tool.executive.calls, [ | 453 self.assertEqual(self.tool.executive.calls, [ |
| 451 ['git', 'cl', 'upload', '-f'], | 454 ['git', 'cl', 'upload', '-f'], |
| 452 ['git', 'pull'], | 455 ['git', 'pull'], |
| 453 ['git', 'cl', 'land', '-f', '-v'], | 456 ['git', 'cl', 'land', '-f', '-v'], |
| 454 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietv
eldissue'], | 457 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietv
eldissue'], |
| 458 ['git', 'cl', 'set_close'], |
| 455 ]) | 459 ]) |
| 456 | 460 |
| 457 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_
to_generic_test_expectations_file()), """ | 461 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_
to_generic_test_expectations_file()), """ |
| 458 Bug(foo) [ Linux Mac Win10 ] fast/dom/prototype-taco.html [ NeedsRebaseline ] | 462 Bug(foo) [ Linux Mac Win10 ] fast/dom/prototype-taco.html [ NeedsRebaseline ] |
| 459 """) | 463 """) |
| 460 finally: | 464 finally: |
| 461 self.tool.scm().current_branch_or_ref = old_branch_name | 465 self.tool.scm().current_branch_or_ref = old_branch_name |
| 462 | 466 |
| 463 def _basic_execute_test(self, expected_executive_calls, auth_refresh_token_j
son=None, commit_author=None, dry_run=False): | 467 def _basic_execute_test(self, expected_executive_calls, auth_refresh_token_j
son=None, commit_author=None, dry_run=False): |
| 464 def blame(_): | 468 def blame(_): |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 """) | 512 """) |
| 509 | 513 |
| 510 def test_execute_with_rietveld_auth_refresh_token(self): | 514 def test_execute_with_rietveld_auth_refresh_token(self): |
| 511 rietveld_refresh_token = '/creds/refresh_tokens/test_rietveld_token' | 515 rietveld_refresh_token = '/creds/refresh_tokens/test_rietveld_token' |
| 512 self._basic_execute_test( | 516 self._basic_execute_test( |
| 513 [ | 517 [ |
| 514 ['git', 'cl', 'upload', '-f', '--auth-refresh-token-json', rietv
eld_refresh_token], | 518 ['git', 'cl', 'upload', '-f', '--auth-refresh-token-json', rietv
eld_refresh_token], |
| 515 ['git', 'pull'], | 519 ['git', 'pull'], |
| 516 ['git', 'cl', 'land', '-f', '-v', '--auth-refresh-token-json', r
ietveld_refresh_token], | 520 ['git', 'cl', 'land', '-f', '-v', '--auth-refresh-token-json', r
ietveld_refresh_token], |
| 517 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietv
eldissue'], | 521 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietv
eldissue'], |
| 522 ['git', 'cl', 'set_close', '--auth-refresh-token-json', rietveld
_refresh_token], |
| 518 ], | 523 ], |
| 519 auth_refresh_token_json=rietveld_refresh_token) | 524 auth_refresh_token_json=rietveld_refresh_token) |
| 520 | 525 |
| 521 def test_execute_with_dry_run(self): | 526 def test_execute_with_dry_run(self): |
| 522 self._basic_execute_test([], dry_run=True) | 527 self._basic_execute_test([], dry_run=True) |
| 523 self.assertEqual(self.tool.scm().local_commits(), []) | 528 self.assertEqual(self.tool.scm().local_commits(), []) |
| 524 | 529 |
| 525 def test_bot_revision_data(self): | 530 def test_bot_revision_data(self): |
| 526 self._setup_mock_build_data() | 531 self._setup_mock_build_data() |
| 527 self.assertEqual( | 532 self.assertEqual( |
| 528 self.command.bot_revision_data(self.tool.scm()), | 533 self.command.bot_revision_data(self.tool.scm()), |
| 529 [{'builder': 'MOCK Win7', 'revision': '9000'}]) | 534 [{'builder': 'MOCK Win7', 'revision': '9000'}]) |
| OLD | NEW |