| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import argparse | 4 import argparse |
| 5 import json | 5 import json |
| 6 import logging | 6 import logging |
| 7 import os | 7 import os |
| 8 import StringIO | 8 import StringIO |
| 9 import sys | 9 import sys |
| 10 import unittest | 10 import unittest |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 }, config) | 435 }, config) |
| 436 | 436 |
| 437 def testUnsupportedTrybot(self): | 437 def testUnsupportedTrybot(self): |
| 438 self.assertRaises( | 438 self.assertRaises( |
| 439 trybot_command.TrybotError, | 439 trybot_command.TrybotError, |
| 440 trybot_command._GetBuilderNames, | 440 trybot_command._GetBuilderNames, |
| 441 'arms-nvidia', | 441 'arms-nvidia', |
| 442 {'win_perf_bisect': 'stuff'} | 442 {'win_perf_bisect': 'stuff'} |
| 443 ) | 443 ) |
| 444 | 444 |
| 445 def testUploadPatchToRietveldGitCommandFailed(self): | 445 |
| 446 command, options = self._SetupTrybotCommand({'linux_perf_bisect': 'stuff'}, | 446 def testGetChangeListCommandError(self): |
| 447 'linux') | 447 command, _ = self._SetupTrybotCommand( |
| 448 {'linux_perf_bisect': 'stuff'}, 'linux') |
| 448 self._ExpectProcesses(( | 449 self._ExpectProcesses(( |
| 449 (['git', 'cl', 'upload', '-f', '--bypass-hooks', '-m', | 450 (['git', 'cl', 'issue'], (128, None, None)), |
| 450 ('CL for src perf tryjob to run sunspider benchmark on linux ' | |
| 451 'platform(s)')], | |
| 452 (128, None, None)), | |
| 453 )) | 451 )) |
| 454 self._AssertTryBotExceptions( | 452 self._AssertTryBotExceptions( |
| 455 'Could not upload to rietveld for src', | 453 'Failed to run "git cl issue" command.', |
| 456 command._UploadPatchToRietveld, | 454 command._GetChangeList) |
| 457 'src', | |
| 458 options | |
| 459 ) | |
| 460 | 455 |
| 461 def testUploadPatchToRietveldNoURLMatchFound(self): | 456 def testGetChangeListNoIssues(self): |
| 462 command, options = self._SetupTrybotCommand({'linux_perf_bisect': 'stuff'}, | 457 command, _ = self._SetupTrybotCommand( |
| 463 'linux') | 458 {'linux_perf_bisect': 'stuff'}, 'linux') |
| 464 self._ExpectProcesses(( | 459 self._ExpectProcesses(( |
| 465 (['git', 'cl', 'upload', '-f', '--bypass-hooks', '-m', | 460 (['git', 'cl', 'issue'], (0, 'Issue number: None (None)', None)), |
| 466 ('CL for src perf tryjob to run sunspider benchmark on linux ' | |
| 467 'platform(s)')], | |
| 468 (0, 'stuff https://dummy.chromium.org/12345 stuff', None)), | |
| 469 )) | 461 )) |
| 470 self._AssertTryBotExceptions( | 462 self._AssertTryBotExceptions( |
| 471 'Could not upload CL to rietveld for src!', | 463 ('PLEASE NOTE: The workflow for Perf Try jobs is changed. ' |
| 472 command._UploadPatchToRietveld, | 464 'In order to run the perf try job, you must first upload your ' |
| 473 'src', | 465 'changes to rietveld.'), |
| 474 options | 466 command._GetChangeList) |
| 475 ) | |
| 476 | 467 |
| 477 def testUploadPatchToRietveldOnSuccess(self): | 468 def testGetChangeListWithIssue(self): |
| 478 command, options = self._SetupTrybotCommand({'linux_perf_bisect': 'stuff'}, | 469 command, _ = self._SetupTrybotCommand( |
| 479 'linux') | 470 {'linux_perf_bisect': 'stuff'}, 'linux') |
| 480 self._ExpectProcesses(( | 471 self._ExpectProcesses(( |
| 481 (['git', 'cl', 'upload', '-f', '--bypass-hooks', '-m', | 472 (['git', 'cl', 'issue'], |
| 482 ('CL for src perf tryjob to run sunspider benchmark on linux ' | |
| 483 'platform(s)')], | |
| 484 (0, 'stuff https://codereview.chromium.org/12345 stuff', None)), | 473 (0, 'stuff https://codereview.chromium.org/12345 stuff', None)), |
| 485 )) | 474 )) |
| 486 self.assertEquals(command._UploadPatchToRietveld('src', options), | 475 self.assertEquals('https://codereview.chromium.org/12345', |
| 487 'https://codereview.chromium.org/12345') | 476 command._GetChangeList()) |
| 488 | 477 |
| 489 def testRunTryJobFailed(self): | 478 def testRunTryJobFailed(self): |
| 490 test_args = self._ExpectedGitTryTestArgs('sunspider', 'release') | 479 test_args = self._ExpectedGitTryTestArgs('sunspider', 'release') |
| 491 command, options = self._SetupTrybotCommand( | 480 command, options = self._SetupTrybotCommand( |
| 492 {'linux_perf_bisect': 'stuff'}, 'linux', repo_path='path_to_repo/src') | 481 {'linux_perf_bisect': 'stuff'}, 'linux', repo_path='path_to_repo/src') |
| 493 arguments = [options.benchmark_name] + [] | 482 arguments = [options.benchmark_name] + [] |
| 494 self._ExpectProcesses(( | 483 self._ExpectProcesses(( |
| 495 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', | 484 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', |
| 496 '-p', test_args, | 485 '-p', test_args, |
| 497 '-b', | 486 '-b', |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 def testAttemptTryjobForCrRepo(self): | 603 def testAttemptTryjobForCrRepo(self): |
| 615 test_args = self._ExpectedGitTryTestArgs('sunspider', 'release') | 604 test_args = self._ExpectedGitTryTestArgs('sunspider', 'release') |
| 616 command, options = self._SetupTrybotCommand({'linux_perf_bisect': 'stuff'}, | 605 command, options = self._SetupTrybotCommand({'linux_perf_bisect': 'stuff'}, |
| 617 'linux') | 606 'linux') |
| 618 self._ExpectProcesses(( | 607 self._ExpectProcesses(( |
| 619 (['git', 'rev-parse', '--abbrev-ref', '--show-toplevel', 'HEAD'], | 608 (['git', 'rev-parse', '--abbrev-ref', '--show-toplevel', 'HEAD'], |
| 620 (0, '/root/path_to/repo/src\nbr\n', None)), | 609 (0, '/root/path_to/repo/src\nbr\n', None)), |
| 621 (['git', 'update-index', '--refresh', '-q'], (0, '', None,)), | 610 (['git', 'update-index', '--refresh', '-q'], (0, '', None,)), |
| 622 (['git', 'diff-index', 'HEAD'], (0, '', None)), | 611 (['git', 'diff-index', 'HEAD'], (0, '', None)), |
| 623 (['git', 'footers', 'HEAD'], (0, '', None)), | 612 (['git', 'footers', 'HEAD'], (0, '', None)), |
| 624 (['git', 'cl', 'upload', '-f', '--bypass-hooks', '-m', | 613 (['git', 'cl', 'issue'], |
| 625 ('CL for src perf tryjob to run sunspider benchmark on linux ' | |
| 626 'platform(s)')], | |
| 627 (0, 'stuff https://codereview.chromium.org/12345 stuff', None)), | 614 (0, 'stuff https://codereview.chromium.org/12345 stuff', None)), |
| 628 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', | 615 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', |
| 629 '-p', test_args, '-b', 'linux_perf_bisect'], (0, '', None)) | 616 '-p', test_args, '-b', 'linux_perf_bisect'], (0, '', None)) |
| 630 )) | 617 )) |
| 631 command._AttemptTryjob(options, []) | 618 command._AttemptTryjob(options, []) |
| 632 | 619 |
| 633 output = ('Uploaded try job to rietveld.\n' | 620 output = ('Running try job....\n' |
| 634 'view progress here https://codereview.chromium.org/12345.\n' | 621 'view progress here https://codereview.chromium.org/12345.\n' |
| 635 '\tRepo Name: src\n' | 622 '\tRepo Name: src\n' |
| 636 '\tPath: %s\n' | 623 '\tPath: %s\n' |
| 637 '\tBranch: br\n' | 624 '\tBranch: br\n' |
| 638 'Perf Try job sent to rietveld for linux platform.') % ( | 625 'Perf Try job sent to rietveld for linux platform.') % ( |
| 639 options.repo_path) | 626 options.repo_path) |
| 640 self.assertEquals(output, sys.stdout.getvalue().strip()) | 627 self.assertEquals(output, sys.stdout.getvalue().strip()) |
| 641 | 628 |
| 642 @mock.patch('core.trybot_command.os.chdir', mock.MagicMock()) | 629 @mock.patch('core.trybot_command.os.chdir', mock.MagicMock()) |
| 643 @mock.patch('core.trybot_command.os.path.exists', | 630 @mock.patch('core.trybot_command.os.path.exists', |
| (...skipping 12 matching lines...) Expand all Loading... |
| 656 'win_perf_bisect': 'stuff', | 643 'win_perf_bisect': 'stuff', |
| 657 'winx64_perf_bisect': 'stuff', | 644 'winx64_perf_bisect': 'stuff', |
| 658 'android_perf_bisect': 'stuff', | 645 'android_perf_bisect': 'stuff', |
| 659 'mac_perf_bisect': 'stuff'}, 'all') | 646 'mac_perf_bisect': 'stuff'}, 'all') |
| 660 self._ExpectProcesses(( | 647 self._ExpectProcesses(( |
| 661 (['git', 'rev-parse', '--abbrev-ref', '--show-toplevel', 'HEAD'], | 648 (['git', 'rev-parse', '--abbrev-ref', '--show-toplevel', 'HEAD'], |
| 662 (0, '/root/path_to/repo/src\nbr\n', None)), | 649 (0, '/root/path_to/repo/src\nbr\n', None)), |
| 663 (['git', 'update-index', '--refresh', '-q'], (0, '', None,)), | 650 (['git', 'update-index', '--refresh', '-q'], (0, '', None,)), |
| 664 (['git', 'diff-index', 'HEAD'], (0, '', None)), | 651 (['git', 'diff-index', 'HEAD'], (0, '', None)), |
| 665 (['git', 'footers', 'HEAD'], (0, '', None)), | 652 (['git', 'footers', 'HEAD'], (0, '', None)), |
| 666 (['git', 'cl', 'upload', '-f', '--bypass-hooks', '-m', | 653 (['git', 'cl', 'issue'], |
| 667 ('CL for src perf tryjob to run sunspider benchmark on all ' | |
| 668 'platform(s)')], | |
| 669 (0, 'stuff https://codereview.chromium.org/12345 stuff', None)), | 654 (0, 'stuff https://codereview.chromium.org/12345 stuff', None)), |
| 670 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', | 655 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', |
| 671 '-p', default_config, '-b', 'win_perf_bisect'], (0, '', None)), | 656 '-p', default_config, '-b', 'win_perf_bisect'], (0, '', None)), |
| 672 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', | 657 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', |
| 673 '-p', android_config, '-b', 'android_perf_bisect'], (0, '', None)), | 658 '-p', android_config, '-b', 'android_perf_bisect'], (0, '', None)), |
| 674 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', | 659 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', |
| 675 '-p', winx64_config, '-b', 'winx64_perf_bisect'], (0, '', None)), | 660 '-p', winx64_config, '-b', 'winx64_perf_bisect'], (0, '', None)), |
| 676 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', | 661 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', |
| 677 '-p', default_config, '-b', 'mac_perf_bisect'], (0, '', None)), | 662 '-p', default_config, '-b', 'mac_perf_bisect'], (0, '', None)), |
| 678 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', | 663 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', |
| 679 '-p', default_config, '-b', 'linux_perf_bisect'], (0, '', None)), | 664 '-p', default_config, '-b', 'linux_perf_bisect'], (0, '', None)), |
| 680 )) | 665 )) |
| 681 command._AttemptTryjob(options, []) | 666 command._AttemptTryjob(options, []) |
| 682 output = ('Uploaded try job to rietveld.\n' | 667 output = ('Running try job....\n' |
| 683 'view progress here https://codereview.chromium.org/12345.\n' | 668 'view progress here https://codereview.chromium.org/12345.\n' |
| 684 '\tRepo Name: src\n' | 669 '\tRepo Name: src\n' |
| 685 '\tPath: %s\n' | 670 '\tPath: %s\n' |
| 686 '\tBranch: br\n' | 671 '\tBranch: br\n' |
| 687 'Perf Try job sent to rietveld for win platform.\n' | 672 'Perf Try job sent to rietveld for win platform.\n' |
| 688 'Perf Try job sent to rietveld for android platform.\n' | 673 'Perf Try job sent to rietveld for android platform.\n' |
| 689 'Perf Try job sent to rietveld for win-x64 platform.\n' | 674 'Perf Try job sent to rietveld for win-x64 platform.\n' |
| 690 'Perf Try job sent to rietveld for mac platform.\n' | 675 'Perf Try job sent to rietveld for mac platform.\n' |
| 691 'Perf Try job sent to rietveld for linux platform.') % ( | 676 'Perf Try job sent to rietveld for linux platform.') % ( |
| 692 options.repo_path) | 677 options.repo_path) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 709 (['git', 'update-index', '--refresh', '-q'], (0, '', None,)), | 694 (['git', 'update-index', '--refresh', '-q'], (0, '', None,)), |
| 710 (['git', 'diff-index', 'HEAD'], (0, '', None)), | 695 (['git', 'diff-index', 'HEAD'], (0, '', None)), |
| 711 (['git', 'footers', 'HEAD'], (0, '', None)), | 696 (['git', 'footers', 'HEAD'], (0, '', None)), |
| 712 (['git', 'config', 'branch.br.remote'], (0, '.', None)), | 697 (['git', 'config', 'branch.br.remote'], (0, '.', None)), |
| 713 (['git', 'rev-parse', '--abbrev-ref', 'br@{upstream}'], | 698 (['git', 'rev-parse', '--abbrev-ref', 'br@{upstream}'], |
| 714 (0, 'br1', None,)), | 699 (0, 'br1', None,)), |
| 715 (['git', 'config', 'branch.br1.remote'], (0, 'origin', None)), | 700 (['git', 'config', 'branch.br1.remote'], (0, 'origin', None)), |
| 716 (['git', 'config', 'remote.origin.url'], | 701 (['git', 'config', 'remote.origin.url'], |
| 717 (0, 'https://chromium.googlesource.com/v8/v8.git', None)), | 702 (0, 'https://chromium.googlesource.com/v8/v8.git', None)), |
| 718 (['git', 'rev-parse', 'br1@{upstream}'], (0, 'feedbeed', None)), | 703 (['git', 'rev-parse', 'br1@{upstream}'], (0, 'feedbeed', None)), |
| 719 (['git', 'cl', 'upload', '-f', '--bypass-hooks', '-m', | 704 (['git', 'cl', 'issue'], |
| 720 ('CL for v8 perf tryjob to run sunspider benchmark on linux ' | |
| 721 'platform(s)')], | |
| 722 (0, 'stuff https://codereview.chromium.org/12345 stuff', None)), | 705 (0, 'stuff https://codereview.chromium.org/12345 stuff', None)), |
| 723 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', | 706 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', |
| 724 '-p', test_args, '-p', deps_override_arg, | 707 '-p', test_args, '-p', deps_override_arg, |
| 725 '-b', 'linux_perf_bisect'], (0, '', None)) | 708 '-b', 'linux_perf_bisect'], (0, '', None)) |
| 726 )) | 709 )) |
| 727 command._AttemptTryjob(options, []) | 710 command._AttemptTryjob(options, []) |
| 728 | 711 |
| 729 output = ('Uploaded try job to rietveld.\n' | 712 output = ('Running try job....\n' |
| 730 'view progress here https://codereview.chromium.org/12345.\n' | 713 'view progress here https://codereview.chromium.org/12345.\n' |
| 731 '\tRepo Name: v8\n' | 714 '\tRepo Name: v8\n' |
| 732 '\tPath: root/path_to/repo/v8\n' | 715 '\tPath: root/path_to/repo/v8\n' |
| 733 '\tBranch: br\n' | 716 '\tBranch: br\n' |
| 734 'Perf Try job sent to rietveld for linux platform.') | 717 'Perf Try job sent to rietveld for linux platform.') |
| 735 self.assertEquals(output, sys.stdout.getvalue().strip()) | 718 self.assertEquals(output, sys.stdout.getvalue().strip()) |
| 736 | 719 |
| 737 @mock.patch('core.trybot_command.os.chdir', mock.MagicMock()) | 720 @mock.patch('core.trybot_command.os.chdir', mock.MagicMock()) |
| 738 @mock.patch('core.trybot_command.os.path.exists', | 721 @mock.patch('core.trybot_command.os.path.exists', |
| 739 mock.MagicMock(return_value='True')) | 722 mock.MagicMock(return_value='True')) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 759 (['git', 'diff-index', 'HEAD'], (0, '', None)), | 742 (['git', 'diff-index', 'HEAD'], (0, '', None)), |
| 760 (['git', 'footers', 'HEAD'], (0, '', None)), | 743 (['git', 'footers', 'HEAD'], (0, '', None)), |
| 761 (['git', 'config', 'branch.br.remote'], (0, '.', None)), | 744 (['git', 'config', 'branch.br.remote'], (0, '.', None)), |
| 762 (['git', 'rev-parse', '--abbrev-ref', 'br@{upstream}'], | 745 (['git', 'rev-parse', '--abbrev-ref', 'br@{upstream}'], |
| 763 (0, 'br1', None,)), | 746 (0, 'br1', None,)), |
| 764 (['git', 'config', 'branch.br1.remote'], (0, 'origin', None)), | 747 (['git', 'config', 'branch.br1.remote'], (0, 'origin', None)), |
| 765 (['git', 'config', 'remote.origin.url'], | 748 (['git', 'config', 'remote.origin.url'], |
| 766 (0, 'https://chromium.googlesource.com/v8/v8.git', None)), | 749 (0, 'https://chromium.googlesource.com/v8/v8.git', None)), |
| 767 (['git', 'rev-parse', 'br1@{upstream}'], | 750 (['git', 'rev-parse', 'br1@{upstream}'], |
| 768 (0, 'feedbeed', None)), | 751 (0, 'feedbeed', None)), |
| 769 (['git', 'cl', 'upload', '-f', '--bypass-hooks', '-m', | 752 (['git', 'cl', 'issue'], |
| 770 ('CL for v8 perf tryjob to run sunspider benchmark on all ' | |
| 771 'platform(s)')], | |
| 772 (0, 'stuff https://codereview.chromium.org/12345 stuff', None)), | 753 (0, 'stuff https://codereview.chromium.org/12345 stuff', None)), |
| 773 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', | 754 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', |
| 774 '-p', android_config, '-p', deps_override_arg, | 755 '-p', android_config, '-p', deps_override_arg, |
| 775 '-b', 'android_perf_bisect'], (0, '', None)), | 756 '-b', 'android_perf_bisect'], (0, '', None)), |
| 776 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', | 757 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', |
| 777 '-p', winx64_config, '-p', deps_override_arg, | 758 '-p', winx64_config, '-p', deps_override_arg, |
| 778 '-b', 'winx64_perf_bisect'], (0, '', None)), | 759 '-b', 'winx64_perf_bisect'], (0, '', None)), |
| 779 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', | 760 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', |
| 780 '-p', default_config, '-p', deps_override_arg, | 761 '-p', default_config, '-p', deps_override_arg, |
| 781 '-b', 'linux_perf_bisect'], (0, '', None)), | 762 '-b', 'linux_perf_bisect'], (0, '', None)), |
| 782 )) | 763 )) |
| 783 command._AttemptTryjob(options, []) | 764 command._AttemptTryjob(options, []) |
| 784 output = ('Uploaded try job to rietveld.\n' | 765 output = ('Running try job....\n' |
| 785 'view progress here https://codereview.chromium.org/12345.\n' | 766 'view progress here https://codereview.chromium.org/12345.\n' |
| 786 '\tRepo Name: v8\n' | 767 '\tRepo Name: v8\n' |
| 787 '\tPath: root/path_to/repo/v8\n' | 768 '\tPath: root/path_to/repo/v8\n' |
| 788 '\tBranch: br\n' | 769 '\tBranch: br\n' |
| 789 'Perf Try job sent to rietveld for android platform.\n' | 770 'Perf Try job sent to rietveld for android platform.\n' |
| 790 'Perf Try job sent to rietveld for win-x64 platform.\n' | 771 'Perf Try job sent to rietveld for win-x64 platform.\n' |
| 791 'Perf Try job sent to rietveld for linux platform.') | 772 'Perf Try job sent to rietveld for linux platform.') |
| 792 self.assertEquals(output, sys.stdout.getvalue().strip()) | 773 self.assertEquals(output, sys.stdout.getvalue().strip()) |
| 793 | 774 |
| 794 @mock.patch('core.trybot_command.os.chdir', mock.MagicMock()) | 775 @mock.patch('core.trybot_command.os.chdir', mock.MagicMock()) |
| 795 @mock.patch('core.trybot_command.os.path.exists', | 776 @mock.patch('core.trybot_command.os.path.exists', |
| 796 mock.MagicMock(return_value='True')) | 777 mock.MagicMock(return_value='True')) |
| 797 @mock.patch('core.trybot_command.os.path.abspath', | 778 @mock.patch('core.trybot_command.os.path.abspath', |
| 798 mock.MagicMock(return_value='root/path_to/repo/v8')) | 779 mock.MagicMock(return_value='root/path_to/repo/v8')) |
| 799 def testAttemptTryjobWithDepsRevisionArg(self): | 780 def testAttemptTryjobWithDepsRevisionArg(self): |
| 800 test_args = self._ExpectedGitTryTestArgs('sunspider', 'release') | 781 test_args = self._ExpectedGitTryTestArgs('sunspider', 'release') |
| 801 deps_override_arg = 'deps_revision_overrides={"src/v8": "feedbeed"}' | 782 deps_override_arg = 'deps_revision_overrides={"src/v8": "feedbeed"}' |
| 802 command, options = self._SetupTrybotCommand( | 783 command, options = self._SetupTrybotCommand( |
| 803 {'linux_perf_bisect': 'stuff'}, 'linux', | 784 {'linux_perf_bisect': 'stuff'}, 'linux', |
| 804 repo_path='root/path_to/repo/v8', deps_revision='feedbeed') | 785 repo_path='root/path_to/repo/v8', deps_revision='feedbeed') |
| 805 self._ExpectProcesses(( | 786 self._ExpectProcesses(( |
| 806 (['git', 'rev-parse', '--abbrev-ref', '--show-toplevel', 'HEAD'], | 787 (['git', 'rev-parse', '--abbrev-ref', '--show-toplevel', 'HEAD'], |
| 807 (0, 'root/path_to/repo/v8\nbr\n', None)), | 788 (0, 'root/path_to/repo/v8\nbr\n', None)), |
| 808 (['git', 'update-index', '--refresh', '-q'], (0, '', None,)), | 789 (['git', 'update-index', '--refresh', '-q'], (0, '', None,)), |
| 809 (['git', 'diff-index', 'HEAD'], (0, '', None)), | 790 (['git', 'diff-index', 'HEAD'], (0, '', None)), |
| 810 (['git', 'footers', 'HEAD'], (0, '', None)), | 791 (['git', 'footers', 'HEAD'], (0, '', None)), |
| 811 (['git', 'cl', 'upload', '-f', '--bypass-hooks', '-m', | 792 (['git', 'cl', 'issue'], |
| 812 ('CL for v8 perf tryjob to run sunspider benchmark on linux ' | |
| 813 'platform(s)')], | |
| 814 (0, 'stuff https://codereview.chromium.org/12345 stuff', None)), | 793 (0, 'stuff https://codereview.chromium.org/12345 stuff', None)), |
| 815 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', | 794 (['git', 'cl', 'try', '-m', 'tryserver.chromium.perf', |
| 816 '-p', test_args, '-p', deps_override_arg, | 795 '-p', test_args, '-p', deps_override_arg, |
| 817 '-b', 'linux_perf_bisect'], (0, '', None)) | 796 '-b', 'linux_perf_bisect'], (0, '', None)) |
| 818 )) | 797 )) |
| 819 command._AttemptTryjob(options, []) | 798 command._AttemptTryjob(options, []) |
| 820 | 799 |
| 821 output = ('Uploaded try job to rietveld.\n' | 800 output = ('Running try job....\n' |
| 822 'view progress here https://codereview.chromium.org/12345.\n' | 801 'view progress here https://codereview.chromium.org/12345.\n' |
| 823 '\tRepo Name: v8\n' | 802 '\tRepo Name: v8\n' |
| 824 '\tPath: root/path_to/repo/v8\n' | 803 '\tPath: root/path_to/repo/v8\n' |
| 825 '\tBranch: br\n' | 804 '\tBranch: br\n' |
| 826 'Perf Try job sent to rietveld for linux platform.') | 805 'Perf Try job sent to rietveld for linux platform.') |
| 827 self.assertEquals(output, sys.stdout.getvalue().strip()) | 806 self.assertEquals(output, sys.stdout.getvalue().strip()) |
| 828 | 807 |
| 829 | 808 |
| 830 class IsBenchmarkDisabledOnTrybotPlatformTest(unittest.TestCase): | 809 class IsBenchmarkDisabledOnTrybotPlatformTest(unittest.TestCase): |
| 831 | 810 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 @benchmark.Enabled('win', 'mac') | 847 @benchmark.Enabled('win', 'mac') |
| 869 class FooBenchmark(benchmark.Benchmark): | 848 class FooBenchmark(benchmark.Benchmark): |
| 870 pass | 849 pass |
| 871 self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'all')) | 850 self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'all')) |
| 872 self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'all-mac')) | 851 self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'all-mac')) |
| 873 self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'winx64ati')) | 852 self.assertFalse(self.IsBenchmarkDisabled(FooBenchmark, 'winx64ati')) |
| 874 | 853 |
| 875 self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'android-s5')) | 854 self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'android-s5')) |
| 876 self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'linux')) | 855 self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'linux')) |
| 877 self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'all-linux')) | 856 self.assertTrue(self.IsBenchmarkDisabled(FooBenchmark, 'all-linux')) |
| OLD | NEW |