Chromium Code Reviews| 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 unittest | 5 import unittest |
| 6 | 6 |
| 7 from webkitpy.common.net.buildbot_mock import MockBuilder | 7 from webkitpy.common.net.buildbot_mock import MockBuilder |
| 8 from webkitpy.common.net.layouttestresults import LayoutTestResults | 8 from webkitpy.common.net.layouttestresults import LayoutTestResults |
| 9 from webkitpy.common.system.executive_mock import MockExecutive | 9 from webkitpy.common.system.executive_mock import MockExecutive |
| 10 from webkitpy.common.system.executive_mock import MockExecutive2 | 10 from webkitpy.common.system.executive_mock import MockExecutive2 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 self.tool.filesystem.write_text_file(self._expand(path), contents) | 75 self.tool.filesystem.write_text_file(self._expand(path), contents) |
| 76 | 76 |
| 77 def _zero_out_test_expectations(self): | 77 def _zero_out_test_expectations(self): |
| 78 for port_name in self.tool.port_factory.all_port_names(): | 78 for port_name in self.tool.port_factory.all_port_names(): |
| 79 port = self.tool.port_factory.get(port_name) | 79 port = self.tool.port_factory.get(port_name) |
| 80 for path in port.expectations_files(): | 80 for path in port.expectations_files(): |
| 81 self._write(path, '') | 81 self._write(path, '') |
| 82 self.tool.filesystem.written_files = {} | 82 self.tool.filesystem.written_files = {} |
| 83 | 83 |
| 84 def _setup_mock_builder_data(self): | 84 def _setup_mock_builder_data(self): |
| 85 data = LayoutTestResults.results_from_string("""ADD_RESULTS({ | 85 data = LayoutTestResults({ |
| 86 "tests": { | 86 "tests": { |
| 87 "userscripts": { | 87 "userscripts": { |
| 88 "first-test.html": { | 88 "first-test.html": { |
| 89 "expected": "PASS", | 89 "expected": "PASS", |
| 90 "actual": "IMAGE+TEXT" | 90 "actual": "IMAGE+TEXT" |
| 91 }, | 91 }, |
| 92 "second-test.html": { | 92 "second-test.html": { |
| 93 "expected": "FAIL", | 93 "expected": "FAIL", |
| 94 "actual": "IMAGE+TEXT" | 94 "actual": "IMAGE+TEXT" |
| 95 } | |
| 96 } | |
| 95 } | 97 } |
| 96 } | 98 }) |
| 97 } | |
| 98 });""") | |
| 99 for builder in ['MOCK Win7', 'MOCK Win7 (dbg)', 'MOCK Mac10.11']: | 99 for builder in ['MOCK Win7', 'MOCK Win7 (dbg)', 'MOCK Mac10.11']: |
| 100 self.command._builder_data[builder] = data | 100 self.command._builder_data[builder] = data |
| 101 | 101 |
| 102 | |
| 103 class TestCopyExistingBaselinesInternal(BaseTestCase): | 102 class TestCopyExistingBaselinesInternal(BaseTestCase): |
| 104 command_constructor = CopyExistingBaselinesInternal | 103 command_constructor = CopyExistingBaselinesInternal |
| 105 | 104 |
| 106 def setUp(self): | 105 def setUp(self): |
| 107 super(TestCopyExistingBaselinesInternal, self).setUp() | 106 super(TestCopyExistingBaselinesInternal, self).setUp() |
| 108 | 107 |
| 109 def test_copying_overwritten_baseline(self): | 108 def test_copying_overwritten_baseline(self): |
| 110 self.tool.executive = MockExecutive2() | 109 self.tool.executive = MockExecutive2() |
| 111 | 110 |
| 112 port = self.tool.port_factory.get('test-mac-mac10.10') | 111 port = self.tool.port_factory.get('test-mac-mac10.10') |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 super(TestRebaselineJson, self).setUp() | 330 super(TestRebaselineJson, self).setUp() |
| 332 self.tool.executive = MockExecutive2() | 331 self.tool.executive = MockExecutive2() |
| 333 | 332 |
| 334 def tearDown(self): | 333 def tearDown(self): |
| 335 super(TestRebaselineJson, self).tearDown() | 334 super(TestRebaselineJson, self).tearDown() |
| 336 | 335 |
| 337 def test_rebaseline_test_passes_on_all_builders(self): | 336 def test_rebaseline_test_passes_on_all_builders(self): |
| 338 self._setup_mock_builder_data() | 337 self._setup_mock_builder_data() |
| 339 | 338 |
| 340 def builder_data(): | 339 def builder_data(): |
| 341 self.command._builder_data['MOCK Win7'] = LayoutTestResults.results_ from_string("""ADD_RESULTS({ | 340 self.command._builder_data['MOCK Win7'] = LayoutTestResults({ |
| 342 "tests": { | 341 "tests": { |
| 343 "userscripts": { | 342 "userscripts": { |
| 344 "first-test.html": { | 343 "first-test.html": { |
| 345 "expected": "NEEDSREBASELINE", | 344 "expected": "NEEDSREBASELINE", |
| 346 "actual": "PASS" | 345 "actual": "PASS" |
| 347 } | 346 } |
| 348 } | 347 } |
| 349 } | 348 } |
| 350 });""") | 349 }) |
| 351 return self.command._builder_data | 350 return self.command._builder_data |
| 352 | 351 |
| 353 self.command.builder_data = builder_data | 352 self.command.builder_data = builder_data |
| 354 | 353 |
| 355 options = MockOptions(optimize=True, verbose=True, results_directory=Non e) | 354 options = MockOptions(optimize=True, verbose=True, results_directory=Non e) |
| 356 | 355 |
| 357 self._write(self.mac_expectations_path, "Bug(x) userscripts/first-test.h tml [ Failure ]\n") | 356 self._write(self.mac_expectations_path, "Bug(x) userscripts/first-test.h tml [ Failure ]\n") |
| 358 self._write("userscripts/first-test.html", "Dummy test contents") | 357 self._write("userscripts/first-test.html", "Dummy test contents") |
| 359 | 358 |
| 360 self.command._rebaseline(options, {"userscripts/first-test.html": {"MOCK Win7": ["txt", "png"]}}) | 359 self.command._rebaseline(options, {"userscripts/first-test.html": {"MOCK Win7": ["txt", "png"]}}) |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 596 def _write_test_file(self, port, path, contents): | 595 def _write_test_file(self, port, path, contents): |
| 597 abs_path = self.tool.filesystem.join(port.layout_tests_dir(), path) | 596 abs_path = self.tool.filesystem.join(port.layout_tests_dir(), path) |
| 598 self.tool.filesystem.write_text_file(abs_path, contents) | 597 self.tool.filesystem.write_text_file(abs_path, contents) |
| 599 | 598 |
| 600 def test_rebaseline_expectations(self): | 599 def test_rebaseline_expectations(self): |
| 601 self._zero_out_test_expectations() | 600 self._zero_out_test_expectations() |
| 602 | 601 |
| 603 self.tool.executive = MockExecutive2() | 602 self.tool.executive = MockExecutive2() |
| 604 | 603 |
| 605 def builder_data(): | 604 def builder_data(): |
| 606 self.command._builder_data['MOCK Mac10.11'] = self.command._builder_ data['MOCK Mac10.10'] = LayoutTestResults.results_from_string("""ADD_RESULTS({ | 605 self.command._builder_data['MOCK Mac10.11'] = self.command._builder_ data['MOCK Mac10.10'] = LayoutTestResults({ |
| 607 "tests": { | 606 "tests": { |
| 608 "userscripts": { | 607 "userscripts": { |
| 609 "another-test.html": { | 608 "another-test.html": { |
| 610 "expected": "PASS", | 609 "expected": "PASS", |
| 611 "actual": "PASS TEXT" | 610 "actual": "PASS TEXT" |
| 612 }, | 611 }, |
| 613 "images.svg": { | 612 "images.svg": { |
| 614 "expected": "FAIL", | 613 "expected": "FAIL", |
| 615 "actual": "IMAGE+TEXT" | 614 "actual": "IMAGE+TEXT" |
| 616 } | 615 } |
| 617 } | 616 } |
| 618 } | 617 } |
| 619 });""") | 618 }) |
| 620 return self.command._builder_data | 619 return self.command._builder_data |
| 621 | 620 |
| 622 self.command.builder_data = builder_data | 621 self.command.builder_data = builder_data |
| 623 | 622 |
| 624 self._write("userscripts/another-test.html", "Dummy test contents") | 623 self._write("userscripts/another-test.html", "Dummy test contents") |
| 625 self._write("userscripts/images.svg", "Dummy test contents") | 624 self._write("userscripts/images.svg", "Dummy test contents") |
| 626 self.command._tests_to_rebaseline = lambda port: { | 625 self.command._tests_to_rebaseline = lambda port: { |
| 627 'userscripts/another-test.html': set(['txt']), | 626 'userscripts/another-test.html': set(['txt']), |
| 628 'userscripts/images.svg': set(['png']), | 627 'userscripts/images.svg': set(['png']), |
| 629 'userscripts/not-actually-failing.html': set(['txt', 'png', 'wav']), | 628 'userscripts/not-actually-failing.html': set(['txt', 'png', 'wav']), |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 653 '--builder', 'MOCK Mac10.11', '--test', 'userscripts/images.svg '], | 652 '--builder', 'MOCK Mac10.11', '--test', 'userscripts/images.svg '], |
| 654 ], | 653 ], |
| 655 ]) | 654 ]) |
| 656 | 655 |
| 657 def test_rebaseline_expectations_reftests(self): | 656 def test_rebaseline_expectations_reftests(self): |
| 658 self._zero_out_test_expectations() | 657 self._zero_out_test_expectations() |
| 659 | 658 |
| 660 self.tool.executive = MockExecutive2() | 659 self.tool.executive = MockExecutive2() |
| 661 | 660 |
| 662 def builder_data(): | 661 def builder_data(): |
| 663 self.command._builder_data['MOCK Mac10.10'] = self.command._builder_ data['MOCK Mac10.11'] = LayoutTestResults.results_from_string("""ADD_RESULTS({ | 662 self.command._builder_data['MOCK Mac10.10'] = self.command._builder_ data['MOCK Mac10.11'] = LayoutTestResults({ |
| 664 "tests": { | 663 "tests": { |
| 665 "userscripts": { | 664 "userscripts": { |
| 666 "reftest-text.html": { | 665 "reftest-text.html": { |
| 667 "expected": "PASS", | 666 "expected": "PASS", |
| 668 "actual": "TEXT" | 667 "actual": "TEXT" |
| 669 }, | 668 }, |
| 670 "reftest-image.html": { | 669 "reftest-image.html": { |
| 671 "expected": "FAIL", | 670 "expected": "FAIL", |
| 672 "actual": "IMAGE" | 671 "actual": "IMAGE" |
| 673 }, | 672 }, |
| 674 "reftest-image-text.html": { | 673 "reftest-image-text.html": { |
| 675 "expected": "FAIL", | 674 "expected": "FAIL", |
| 676 "actual": "IMAGE+TEXT" | 675 "actual": "IMAGE+TEXT" |
| 677 } | 676 } |
| 678 } | 677 } |
| 679 } | 678 } |
| 680 });""") | 679 }) |
| 681 return self.command._builder_data | 680 return self.command._builder_data |
| 682 | 681 |
| 683 self.command.builder_data = builder_data | 682 self.command.builder_data = builder_data |
| 684 | 683 |
| 685 self._write("userscripts/reftest-text.html", "Dummy test contents") | 684 self._write("userscripts/reftest-text.html", "Dummy test contents") |
| 686 self._write("userscripts/reftest-text-expected.html", "Dummy test conten ts") | 685 self._write("userscripts/reftest-text-expected.html", "Dummy test conten ts") |
| 687 self._write("userscripts/reftest-text-expected.html", "Dummy test conten ts") | 686 self._write("userscripts/reftest-text-expected.html", "Dummy test conten ts") |
| 688 self.command._tests_to_rebaseline = lambda port: { | 687 self.command._tests_to_rebaseline = lambda port: { |
| 689 'userscripts/reftest-text.html': set(['txt']), | 688 'userscripts/reftest-text.html': set(['txt']), |
| 690 'userscripts/reftest-image.html': set(['png']), | 689 'userscripts/reftest-image.html': set(['png']), |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 739 def test_rebaseline_without_other_expectations(self): | 738 def test_rebaseline_without_other_expectations(self): |
| 740 self._write("userscripts/another-test.html", "Dummy test contents") | 739 self._write("userscripts/another-test.html", "Dummy test contents") |
| 741 self._write(self.mac_expectations_path, "Bug(x) userscripts/another-test .html [ Rebaseline ]\n") | 740 self._write(self.mac_expectations_path, "Bug(x) userscripts/another-test .html [ Rebaseline ]\n") |
| 742 self.assertDictEqual(self.command._tests_to_rebaseline(self.mac_port), | 741 self.assertDictEqual(self.command._tests_to_rebaseline(self.mac_port), |
| 743 {'userscripts/another-test.html': ('png', 'wav', 't xt')}) | 742 {'userscripts/another-test.html': ('png', 'wav', 't xt')}) |
| 744 | 743 |
| 745 def test_rebaseline_test_passes_everywhere(self): | 744 def test_rebaseline_test_passes_everywhere(self): |
| 746 test_port = self.tool.port_factory.get('test') | 745 test_port = self.tool.port_factory.get('test') |
| 747 | 746 |
| 748 def builder_data(): | 747 def builder_data(): |
| 749 self.command._builder_data['MOCK Mac10.10'] = self.command._builder_ data['MOCK Mac10.11'] = LayoutTestResults.results_from_string("""ADD_RESULTS({ | 748 self.command._builder_data['MOCK Mac10.10'] = self.command._builder_ data['MOCK Mac10.11'] = LayoutTestResults({ |
| 750 "tests": { | 749 "tests": { |
| 751 "fast": { | 750 "fast": { |
| 752 "dom": { | 751 "dom": { |
| 753 "prototype-taco.html": { | 752 "prototype-taco.html": { |
| 754 "expected": "FAIL", | 753 "expected": "FAIL", |
| 755 "actual": "PASS", | 754 "actual": "PASS", |
| 756 "is_unexpected": true | 755 "is_unexpected": True |
| 756 } | |
| 757 } | |
| 758 } | |
| 757 } | 759 } |
| 758 } | 760 }) |
| 759 } | |
| 760 } | |
| 761 });""") | |
| 762 return self.command._builder_data | 761 return self.command._builder_data |
| 763 | 762 |
| 764 self.command.builder_data = builder_data | 763 self.command.builder_data = builder_data |
| 765 | 764 |
| 766 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe ctations_file(), """ | 765 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe ctations_file(), """ |
| 767 Bug(foo) fast/dom/prototype-taco.html [ Rebaseline ] | 766 Bug(foo) fast/dom/prototype-taco.html [ Rebaseline ] |
| 768 """) | 767 """) |
| 769 | 768 |
| 770 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy test contents") | 769 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy test contents") |
| 771 | 770 |
| 772 self.tool.executive = MockLineRemovingExecutive() | 771 self.tool.executive = MockLineRemovingExecutive() |
| 773 | 772 |
| 774 self.tool.builders = BuilderList({ | 773 self.tool.builders = BuilderList({ |
| 775 "MOCK Mac10.10": {"port_name": "test-mac-mac10.10", "specifiers": [" Mac10.10", "Release"]}, | 774 "MOCK Mac10.10": {"port_name": "test-mac-mac10.10", "specifiers": [" Mac10.10", "Release"]}, |
| 776 "MOCK Mac10.11": {"port_name": "test-mac-mac10.11", "specifiers": [" Mac10.11", "Release"]}, | 775 "MOCK Mac10.11": {"port_name": "test-mac-mac10.11", "specifiers": [" Mac10.11", "Release"]}, |
| 777 }) | 776 }) |
| 778 | 777 |
| 779 self.command.execute(self.options, [], self.tool) | 778 self.command.execute(self.options, [], self.tool) |
| 780 self.assertEqual(self.tool.executive.calls, []) | 779 self.assertEqual(self.tool.executive.calls, []) |
| 781 | 780 |
| 782 # The mac ports should both be removed since they're the only ones in th e builder list. | 781 # The mac ports should both be removed since they're the only ones in th e builder list. |
| 783 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_to_g eneric_test_expectations_file()), """ | 782 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_to_g eneric_test_expectations_file()), """ |
| 784 Bug(foo) [ Linux Win ] fast/dom/prototype-taco.html [ Rebaseline ] | 783 Bug(foo) [ Linux Win ] fast/dom/prototype-taco.html [ Rebaseline ] |
| 785 """) | 784 """) |
| 786 | 785 |
| 787 def test_rebaseline_missing(self): | 786 def test_rebaseline_missing(self): |
| 788 def builder_data(): | 787 def builder_data(): |
| 789 self.command._builder_data['MOCK Mac10.10'] = LayoutTestResults.resu lts_from_string("""ADD_RESULTS({ | 788 self.command._builder_data['MOCK Mac10.10'] = LayoutTestResults({ |
| 790 "tests": { | 789 "tests": { |
| 791 "fast": { | 790 "fast": { |
| 792 "dom": { | 791 "dom": { |
| 793 "missing-text.html": { | 792 "missing-text.html": { |
| 794 "expected": "PASS", | 793 "expected": "PASS", |
| 795 "actual": "MISSING", | 794 "actual": "MISSING", |
| 796 "is_unexpected": true, | 795 "is_unexpected": True, |
| 797 "is_missing_text": true | 796 "is_missing_text": True |
| 798 }, | 797 }, |
| 799 "missing-text-and-image.html": { | 798 "missing-text-and-image.html": { |
| 800 "expected": "PASS", | 799 "expected": "PASS", |
| 801 "actual": "MISSING", | 800 "actual": "MISSING", |
| 802 "is_unexpected": true, | 801 "is_unexpected": True, |
| 803 "is_missing_text": true, | 802 "is_missing_text": True, |
| 804 "is_missing_image": true | 803 "is_missing_image": True |
| 805 }, | 804 }, |
| 806 "missing-image.html": { | 805 "missing-image.html": { |
| 807 "expected": "PASS", | 806 "expected": "PASS", |
| 808 "actual": "MISSING", | 807 "actual": "MISSING", |
| 809 "is_unexpected": true, | 808 "is_unexpected": True, |
| 810 "is_missing_image": true | 809 "is_missing_image": True |
| 810 } | |
| 811 } | |
| 812 } | |
| 811 } | 813 } |
| 812 } | 814 }) |
| 813 } | |
| 814 } | |
| 815 });""") | |
| 816 return self.command._builder_data | 815 return self.command._builder_data |
| 817 | 816 |
| 818 self.command.builder_data = builder_data | 817 self.command.builder_data = builder_data |
| 819 | 818 |
| 820 self._write('fast/dom/missing-text.html', "Dummy test contents") | 819 self._write('fast/dom/missing-text.html', "Dummy test contents") |
| 821 self._write('fast/dom/missing-text-and-image.html', "Dummy test contents ") | 820 self._write('fast/dom/missing-text-and-image.html', "Dummy test contents ") |
| 822 self._write('fast/dom/missing-image.html', "Dummy test contents") | 821 self._write('fast/dom/missing-image.html', "Dummy test contents") |
| 823 | 822 |
| 824 self.command._tests_to_rebaseline = lambda port: { | 823 self.command._tests_to_rebaseline = lambda port: { |
| 825 'fast/dom/missing-text.html': set(['txt', 'png']), | 824 'fast/dom/missing-text.html': set(['txt', 'png']), |
| 826 'fast/dom/missing-text-and-image.html': set(['txt', 'png']), | 825 'fast/dom/missing-text-and-image.html': set(['txt', 'png']), |
| 827 'fast/dom/missing-image.html': set(['txt', 'png']), | 826 'fast/dom/missing-image.html': set(['txt', 'png']), |
| 828 } | 827 } |
| 829 | 828 |
| 830 self.command.execute(self.options, [], self.tool) | 829 self.command.execute(self.options, [], self.tool) |
| 831 | 830 |
| 832 print self.tool.executive.calls | |
|
qyearsley
2016/07/11 17:25:21
Print statement accidentally left in in http://crr
| |
| 833 self.assertEqual(self.tool.executive.calls, [ | 831 self.assertEqual(self.tool.executive.calls, [ |
| 834 [ | 832 [ |
| 835 ['python', 'echo', 'copy-existing-baselines-internal', '--suffix es', 'txt', | 833 ['python', 'echo', 'copy-existing-baselines-internal', '--suffix es', 'txt', |
| 836 '--builder', 'MOCK Mac10.10', '--test', 'fast/dom/missing-text. html'], | 834 '--builder', 'MOCK Mac10.10', '--test', 'fast/dom/missing-text. html'], |
| 837 ['python', 'echo', 'copy-existing-baselines-internal', '--suffix es', 'txt,png', | 835 ['python', 'echo', 'copy-existing-baselines-internal', '--suffix es', 'txt,png', |
| 838 '--builder', 'MOCK Mac10.10', '--test', 'fast/dom/missing-text- and-image.html'], | 836 '--builder', 'MOCK Mac10.10', '--test', 'fast/dom/missing-text- and-image.html'], |
| 839 ['python', 'echo', 'copy-existing-baselines-internal', '--suffix es', 'png', | 837 ['python', 'echo', 'copy-existing-baselines-internal', '--suffix es', 'png', |
| 840 '--builder', 'MOCK Mac10.10', '--test', 'fast/dom/missing-image .html'], | 838 '--builder', 'MOCK Mac10.10', '--test', 'fast/dom/missing-image .html'], |
| 841 ], | 839 ], |
| 842 [ | 840 [ |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1047 624caaaaaa path/to/TestExpectations (<foo@chromium.org> 2013-04-28 04:52:41 +0000 12) crbug.com/24182 path/to/not-cycled-through-bots .html [ NeedsRebaseline ] | 1045 624caaaaaa path/to/TestExpectations (<foo@chromium.org> 2013-04-28 04:52:41 +0000 12) crbug.com/24182 path/to/not-cycled-through-bots .html [ NeedsRebaseline ] |
| 1048 0000000000 path/to/TestExpectations (<foo@chromium.org> 2013-04-28 04:52:41 +0000 12) crbug.com/24182 path/to/locally-changed-lined.h tml [ NeedsRebaseline ] | 1046 0000000000 path/to/TestExpectations (<foo@chromium.org> 2013-04-28 04:52:41 +0000 12) crbug.com/24182 path/to/locally-changed-lined.h tml [ NeedsRebaseline ] |
| 1049 """ | 1047 """ |
| 1050 self.tool.scm().blame = blame | 1048 self.tool.scm().blame = blame |
| 1051 | 1049 |
| 1052 test_port = self.tool.port_factory.get('test') | 1050 test_port = self.tool.port_factory.get('test') |
| 1053 | 1051 |
| 1054 original_builder_data = self.command.builder_data | 1052 original_builder_data = self.command.builder_data |
| 1055 def builder_data(): | 1053 def builder_data(): |
| 1056 original_builder_data() | 1054 original_builder_data() |
| 1057 # have prototype-chocolate only fail on "MOCK Mac10.10". | 1055 # Have prototype-chocolate only fail on "MOCK Mac10.11". |
|
qyearsley
2016/07/11 17:25:21
Note, I think this may have been a typo in the CL
| |
| 1058 self.command._builder_data['MOCK Mac10.11'] = LayoutTestResults.resu lts_from_string("""ADD_RESULTS({ | 1056 self.command._builder_data['MOCK Mac10.11'] = LayoutTestResults({ |
| 1059 "tests": { | 1057 "tests": { |
| 1060 "fast": { | 1058 "fast": { |
| 1061 "dom": { | 1059 "dom": { |
| 1062 "prototype-taco.html": { | 1060 "prototype-taco.html": { |
| 1063 "expected": "PASS", | 1061 "expected": "PASS", |
| 1064 "actual": "PASS TEXT", | 1062 "actual": "PASS TEXT", |
| 1065 "is_unexpected": true | 1063 "is_unexpected": True |
| 1066 }, | 1064 }, |
| 1067 "prototype-chocolate.html": { | 1065 "prototype-chocolate.html": { |
| 1068 "expected": "FAIL", | 1066 "expected": "FAIL", |
| 1069 "actual": "PASS" | 1067 "actual": "PASS" |
| 1070 }, | 1068 }, |
| 1071 "prototype-strawberry.html": { | 1069 "prototype-strawberry.html": { |
| 1072 "expected": "PASS", | 1070 "expected": "PASS", |
| 1073 "actual": "IMAGE PASS", | 1071 "actual": "IMAGE PASS", |
| 1074 "is_unexpected": true | 1072 "is_unexpected": True |
| 1073 } | |
| 1074 } | |
| 1075 } | |
| 1075 } | 1076 } |
| 1076 } | 1077 }) |
| 1077 } | |
| 1078 } | |
| 1079 });""") | |
| 1080 return self.command._builder_data | 1078 return self.command._builder_data |
| 1081 | 1079 |
| 1082 self.command.builder_data = builder_data | 1080 self.command.builder_data = builder_data |
| 1083 | 1081 |
| 1084 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe ctations_file(), """ | 1082 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe ctations_file(), """ |
| 1085 crbug.com/24182 [ Debug ] path/to/norebaseline.html [ Rebaseline ] | 1083 crbug.com/24182 [ Debug ] path/to/norebaseline.html [ Rebaseline ] |
| 1086 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] | 1084 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] |
| 1087 crbug.com/24182 [ Mac10.11 ] fast/dom/prototype-strawberry.html [ NeedsRebaselin e ] | 1085 crbug.com/24182 [ Mac10.11 ] fast/dom/prototype-strawberry.html [ NeedsRebaselin e ] |
| 1088 crbug.com/24182 fast/dom/prototype-chocolate.html [ NeedsRebaseline ] | 1086 crbug.com/24182 fast/dom/prototype-chocolate.html [ NeedsRebaseline ] |
| 1089 crbug.com/24182 path/to/not-cycled-through-bots.html [ NeedsRebaseline ] | 1087 crbug.com/24182 path/to/not-cycled-through-bots.html [ NeedsRebaseline ] |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1158 6469e754a1 path/to/TestExpectations (<foobarbaz1@chromium.org> 2013-04-28 04:52:41 +0000 13) Bug(foo) fast/dom/prototype-taco.html [ NeedsRe baseline ] | 1156 6469e754a1 path/to/TestExpectations (<foobarbaz1@chromium.org> 2013-04-28 04:52:41 +0000 13) Bug(foo) fast/dom/prototype-taco.html [ NeedsRe baseline ] |
| 1159 """ | 1157 """ |
| 1160 self.tool.scm().blame = blame | 1158 self.tool.scm().blame = blame |
| 1161 | 1159 |
| 1162 test_port = self.tool.port_factory.get('test') | 1160 test_port = self.tool.port_factory.get('test') |
| 1163 | 1161 |
| 1164 original_builder_data = self.command.builder_data | 1162 original_builder_data = self.command.builder_data |
| 1165 def builder_data(): | 1163 def builder_data(): |
| 1166 original_builder_data() | 1164 original_builder_data() |
| 1167 # have prototype-chocolate only fail on "MOCK Mac10.10". | 1165 # have prototype-chocolate only fail on "MOCK Mac10.10". |
| 1168 self.command._builder_data['MOCK Mac10.11'] = LayoutTestResults.resu lts_from_string("""ADD_RESULTS({ | 1166 self.command._builder_data['MOCK Mac10.11'] = LayoutTestResults({ |
| 1169 "tests": { | 1167 "tests": { |
| 1170 "fast": { | 1168 "fast": { |
| 1171 "dom": { | 1169 "dom": { |
| 1172 "prototype-taco.html": { | 1170 "prototype-taco.html": { |
| 1173 "expected": "PASS", | 1171 "expected": "PASS", |
| 1174 "actual": "PASS TEXT", | 1172 "actual": "PASS TEXT", |
| 1175 "is_unexpected": true | 1173 "is_unexpected": True |
| 1174 } | |
| 1175 } | |
| 1176 } | |
| 1176 } | 1177 } |
| 1177 } | 1178 }) |
| 1178 } | |
| 1179 } | |
| 1180 });""") | |
| 1181 return self.command._builder_data | 1179 return self.command._builder_data |
| 1182 | 1180 |
| 1183 self.command.builder_data = builder_data | 1181 self.command.builder_data = builder_data |
| 1184 | 1182 |
| 1185 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe ctations_file(), """ | 1183 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe ctations_file(), """ |
| 1186 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] | 1184 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] |
| 1187 """) | 1185 """) |
| 1188 | 1186 |
| 1189 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy test contents") | 1187 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy test contents") |
| 1190 | 1188 |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 1214 def test_execute_test_passes_everywhere(self): | 1212 def test_execute_test_passes_everywhere(self): |
| 1215 def blame(_): | 1213 def blame(_): |
| 1216 return """ | 1214 return """ |
| 1217 6469e754a1 path/to/TestExpectations (<foobarbaz1@chromium.org> 2013-04-28 04:52:41 +0000 13) Bug(foo) fast/dom/prototype-taco.html [ NeedsRe baseline ] | 1215 6469e754a1 path/to/TestExpectations (<foobarbaz1@chromium.org> 2013-04-28 04:52:41 +0000 13) Bug(foo) fast/dom/prototype-taco.html [ NeedsRe baseline ] |
| 1218 """ | 1216 """ |
| 1219 self.tool.scm().blame = blame | 1217 self.tool.scm().blame = blame |
| 1220 | 1218 |
| 1221 test_port = self.tool.port_factory.get('test') | 1219 test_port = self.tool.port_factory.get('test') |
| 1222 | 1220 |
| 1223 def builder_data(): | 1221 def builder_data(): |
| 1224 self.command._builder_data['MOCK Mac10.10'] = self.command._builder_ data['MOCK Mac10.11'] = LayoutTestResults.results_from_string("""ADD_RESULTS({ | 1222 self.command._builder_data['MOCK Mac10.10'] = self.command._builder_ data['MOCK Mac10.11'] = LayoutTestResults({ |
| 1225 "tests": { | 1223 "tests": { |
| 1226 "fast": { | 1224 "fast": { |
| 1227 "dom": { | 1225 "dom": { |
| 1228 "prototype-taco.html": { | 1226 "prototype-taco.html": { |
| 1229 "expected": "FAIL", | 1227 "expected": "FAIL", |
| 1230 "actual": "PASS", | 1228 "actual": "PASS", |
| 1231 "is_unexpected": true | 1229 "is_unexpected": True |
| 1230 } | |
| 1231 } | |
| 1232 } | |
| 1232 } | 1233 } |
| 1233 } | 1234 }) |
| 1234 } | |
| 1235 } | |
| 1236 });""") | |
| 1237 return self.command._builder_data | 1235 return self.command._builder_data |
| 1238 | 1236 |
| 1239 self.command.builder_data = builder_data | 1237 self.command.builder_data = builder_data |
| 1240 | 1238 |
| 1241 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe ctations_file(), """ | 1239 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe ctations_file(), """ |
| 1242 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] | 1240 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] |
| 1243 """) | 1241 """) |
| 1244 | 1242 |
| 1245 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy test contents") | 1243 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy test contents") |
| 1246 | 1244 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 1268 def test_execute_use_alternate_rebaseline_branch(self): | 1266 def test_execute_use_alternate_rebaseline_branch(self): |
| 1269 def blame(_): | 1267 def blame(_): |
| 1270 return """ | 1268 return """ |
| 1271 6469e754a1 path/to/TestExpectations (<foobarbaz1@chromium.org> 2013-04-28 04:52:41 +0000 13) Bug(foo) fast/dom/prototype-taco.html [ NeedsRe baseline ] | 1269 6469e754a1 path/to/TestExpectations (<foobarbaz1@chromium.org> 2013-04-28 04:52:41 +0000 13) Bug(foo) fast/dom/prototype-taco.html [ NeedsRe baseline ] |
| 1272 """ | 1270 """ |
| 1273 self.tool.scm().blame = blame | 1271 self.tool.scm().blame = blame |
| 1274 | 1272 |
| 1275 test_port = self.tool.port_factory.get('test') | 1273 test_port = self.tool.port_factory.get('test') |
| 1276 | 1274 |
| 1277 def builder_data(): | 1275 def builder_data(): |
| 1278 self.command._builder_data['MOCK Win'] = LayoutTestResults.results_f rom_string("""ADD_RESULTS({ | 1276 self.command._builder_data['MOCK Win'] = LayoutTestResults({ |
| 1279 "tests": { | 1277 "tests": { |
| 1280 "fast": { | 1278 "fast": { |
| 1281 "dom": { | 1279 "dom": { |
| 1282 "prototype-taco.html": { | 1280 "prototype-taco.html": { |
| 1283 "expected": "FAIL", | 1281 "expected": "FAIL", |
| 1284 "actual": "PASS", | 1282 "actual": "PASS", |
| 1285 "is_unexpected": true | 1283 "is_unexpected": True |
| 1284 } | |
| 1285 } | |
| 1286 } | |
| 1286 } | 1287 } |
| 1287 } | 1288 }) |
| 1288 } | |
| 1289 } | |
| 1290 });""") | |
| 1291 return self.command._builder_data | 1289 return self.command._builder_data |
| 1292 | 1290 |
| 1293 self.command.builder_data = builder_data | 1291 self.command.builder_data = builder_data |
| 1294 | 1292 |
| 1295 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe ctations_file(), """ | 1293 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe ctations_file(), """ |
| 1296 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] | 1294 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] |
| 1297 """) | 1295 """) |
| 1298 | 1296 |
| 1299 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy test contents") | 1297 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy test contents") |
| 1300 | 1298 |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 1324 def test_execute_stuck_on_alternate_rebaseline_branch(self): | 1322 def test_execute_stuck_on_alternate_rebaseline_branch(self): |
| 1325 def blame(_): | 1323 def blame(_): |
| 1326 return """ | 1324 return """ |
| 1327 6469e754a1 path/to/TestExpectations (<foobarbaz1@chromium.org> 2013-04-28 04:52:41 +0000 13) Bug(foo) fast/dom/prototype-taco.html [ NeedsRe baseline ] | 1325 6469e754a1 path/to/TestExpectations (<foobarbaz1@chromium.org> 2013-04-28 04:52:41 +0000 13) Bug(foo) fast/dom/prototype-taco.html [ NeedsRe baseline ] |
| 1328 """ | 1326 """ |
| 1329 self.tool.scm().blame = blame | 1327 self.tool.scm().blame = blame |
| 1330 | 1328 |
| 1331 test_port = self.tool.port_factory.get('test') | 1329 test_port = self.tool.port_factory.get('test') |
| 1332 | 1330 |
| 1333 def builder_data(): | 1331 def builder_data(): |
| 1334 self.command._builder_data['MOCK Win'] = LayoutTestResults.results_f rom_string("""ADD_RESULTS({ | 1332 self.command._builder_data['MOCK Win'] = LayoutTestResults({ |
| 1335 "tests": { | 1333 "tests": { |
| 1336 "fast": { | 1334 "fast": { |
| 1337 "dom": { | 1335 "dom": { |
| 1338 "prototype-taco.html": { | 1336 "prototype-taco.html": { |
| 1339 "expected": "FAIL", | 1337 "expected": "FAIL", |
| 1340 "actual": "PASS", | 1338 "actual": "PASS", |
| 1341 "is_unexpected": true | 1339 "is_unexpected": True |
| 1340 } | |
| 1341 } | |
| 1342 } | |
| 1342 } | 1343 } |
| 1343 } | 1344 }) |
| 1344 } | |
| 1345 } | |
| 1346 });""") | |
| 1347 return self.command._builder_data | 1345 return self.command._builder_data |
| 1348 | 1346 |
| 1349 self.command.builder_data = builder_data | 1347 self.command.builder_data = builder_data |
| 1350 | 1348 |
| 1351 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe ctations_file(), """ | 1349 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe ctations_file(), """ |
| 1352 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] | 1350 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] |
| 1353 """) | 1351 """) |
| 1354 | 1352 |
| 1355 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy test contents") | 1353 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy test contents") |
| 1356 | 1354 |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 1381 def _basic_execute_test(self, expected_executive_calls, auth_refresh_token_j son=None, commit_author=None, dry_run=False): | 1379 def _basic_execute_test(self, expected_executive_calls, auth_refresh_token_j son=None, commit_author=None, dry_run=False): |
| 1382 def blame(_): | 1380 def blame(_): |
| 1383 return """ | 1381 return """ |
| 1384 6469e754a1 path/to/TestExpectations (<foobarbaz1@chromium.org> 2013-04-28 04:52:41 +0000 13) Bug(foo) fast/dom/prototype-taco.html [ NeedsRe baseline ] | 1382 6469e754a1 path/to/TestExpectations (<foobarbaz1@chromium.org> 2013-04-28 04:52:41 +0000 13) Bug(foo) fast/dom/prototype-taco.html [ NeedsRe baseline ] |
| 1385 """ | 1383 """ |
| 1386 self.tool.scm().blame = blame | 1384 self.tool.scm().blame = blame |
| 1387 | 1385 |
| 1388 test_port = self.tool.port_factory.get('test') | 1386 test_port = self.tool.port_factory.get('test') |
| 1389 | 1387 |
| 1390 def builder_data(): | 1388 def builder_data(): |
| 1391 self.command._builder_data['MOCK Mac10.10'] = self.command._builder_ data['MOCK Mac10.11'] = LayoutTestResults.results_from_string("""ADD_RESULTS({ | 1389 self.command._builder_data['MOCK Mac10.10'] = self.command._builder_ data['MOCK Mac10.11'] = LayoutTestResults({ |
| 1392 "tests": { | 1390 "tests": { |
| 1393 "fast": { | 1391 "fast": { |
| 1394 "dom": { | 1392 "dom": { |
| 1395 "prototype-taco.html": { | 1393 "prototype-taco.html": { |
| 1396 "expected": "FAIL", | 1394 "expected": "FAIL", |
| 1397 "actual": "PASS", | 1395 "actual": "PASS", |
| 1398 "is_unexpected": true | 1396 "is_unexpected": True |
| 1397 } | |
| 1398 } | |
| 1399 } | |
| 1399 } | 1400 } |
| 1400 } | 1401 }) |
| 1401 } | |
| 1402 } | |
| 1403 });""") | |
| 1404 return self.command._builder_data | 1402 return self.command._builder_data |
| 1405 | 1403 |
| 1406 self.command.builder_data = builder_data | 1404 self.command.builder_data = builder_data |
| 1407 | 1405 |
| 1408 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe ctations_file(), """ | 1406 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe ctations_file(), """ |
| 1409 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] | 1407 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] |
| 1410 """) | 1408 """) |
| 1411 | 1409 |
| 1412 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy test contents") | 1410 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy test contents") |
| 1413 | 1411 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 1435 ['git', 'cl', 'upload', '-f', '--auth-refresh-token-json', RIETV ELD_REFRESH_TOKEN], | 1433 ['git', 'cl', 'upload', '-f', '--auth-refresh-token-json', RIETV ELD_REFRESH_TOKEN], |
| 1436 ['git', 'pull'], | 1434 ['git', 'pull'], |
| 1437 ['git', 'cl', 'land', '-f', '-v', '--auth-refresh-token-json', R IETVELD_REFRESH_TOKEN], | 1435 ['git', 'cl', 'land', '-f', '-v', '--auth-refresh-token-json', R IETVELD_REFRESH_TOKEN], |
| 1438 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietv eldissue'], | 1436 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietv eldissue'], |
| 1439 ], | 1437 ], |
| 1440 auth_refresh_token_json=RIETVELD_REFRESH_TOKEN) | 1438 auth_refresh_token_json=RIETVELD_REFRESH_TOKEN) |
| 1441 | 1439 |
| 1442 def test_execute_with_dry_run(self): | 1440 def test_execute_with_dry_run(self): |
| 1443 self._basic_execute_test([], dry_run=True) | 1441 self._basic_execute_test([], dry_run=True) |
| 1444 self.assertEqual(self.tool.scm().local_commits(), []) | 1442 self.assertEqual(self.tool.scm().local_commits(), []) |
| OLD | NEW |