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 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 827 "MOCK Mac10.11": {"port_name": "test-mac-mac10.11", "specifiers": [" Mac10.11", "Release"]}, | 827 "MOCK Mac10.11": {"port_name": "test-mac-mac10.11", "specifiers": [" Mac10.11", "Release"]}, |
| 828 }) | 828 }) |
| 829 self.command.execute(self.options, [], self.tool) | 829 self.command.execute(self.options, [], self.tool) |
| 830 self.assertEqual(self.tool.executive.calls, []) | 830 self.assertEqual(self.tool.executive.calls, []) |
| 831 | 831 |
| 832 # The mac ports should both be removed since they're the only ones in bu ilders._exact_matches. | 832 # The mac ports should both be removed since they're the only ones in bu ilders._exact_matches. |
| 833 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_to_g eneric_test_expectations_file()), """ | 833 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_to_g eneric_test_expectations_file()), """ |
| 834 Bug(foo) [ Linux Win ] fast/dom/prototype-taco.html [ Rebaseline ] | 834 Bug(foo) [ Linux Win ] fast/dom/prototype-taco.html [ Rebaseline ] |
| 835 """) | 835 """) |
| 836 | 836 |
| 837 # TODO(crbug.com/574272) - Reenable this after the bug is fixed. | |
| 838 def disabled_test_rebaseline_missing(self): | |
|
wkorman
2016/06/14 19:09:19
Intentionally disabled?
Xianzhu
2016/06/14 19:23:21
Yes, along with other rebaseline tests because we
| |
| 839 def builder_data(): | |
| 840 self.command._builder_data['MOCK Mac10.10'] = LayoutTestResults.resu lts_from_string("""ADD_RESULTS({ | |
| 841 "tests": { | |
| 842 "fast": { | |
| 843 "dom": { | |
| 844 "missing-text.html": { | |
| 845 "expected": "PASS", | |
| 846 "actual": "MISSING", | |
| 847 "is_unexpected": true, | |
| 848 "is_missing_text": true | |
| 849 }, | |
| 850 "missing-text-and-image.html": { | |
| 851 "expected": "PASS", | |
| 852 "actual": "MISSING", | |
| 853 "is_unexpected": true, | |
| 854 "is_missing_text": true, | |
| 855 "is_missing_image": true | |
| 856 }, | |
| 857 "missing-image.html": { | |
| 858 "expected": "PASS", | |
| 859 "actual": "MISSING", | |
| 860 "is_unexpected": true, | |
| 861 "is_missing_image": true | |
| 862 } | |
| 863 } | |
| 864 } | |
| 865 } | |
| 866 });""") | |
| 867 return self.command._builder_data | |
| 868 | |
| 869 self.command.builder_data = builder_data | |
| 870 | |
| 871 self._write('fast/dom/missing-text.html', "Dummy test contents") | |
| 872 self._write('fast/dom/missing-text-and-image.html', "Dummy test contents ") | |
| 873 self._write('fast/dom/missing-image.html', "Dummy test contents") | |
| 874 | |
| 875 self.command._tests_to_rebaseline = lambda port: { | |
| 876 'fast/dom/missing-text.html': set(['txt', 'png']), | |
| 877 'fast/dom/missing-text-and-image.html': set(['txt', 'png']), | |
| 878 'fast/dom/missing-image.html': set(['txt', 'png']), | |
| 879 } | |
| 880 | |
| 881 self.tool.builders = BuilderList({ | |
| 882 "MOCK Mac10.10": {"port_name": "test-mac-mac10.10", "specifiers": [" Mac10.10", "Release"]}, | |
| 883 }) | |
| 884 self.command.execute(self.options, [], self.tool) | |
| 885 | |
| 886 print self.tool.executive.calls | |
| 887 self.assertEqual(self.tool.executive.calls, [ | |
| 888 [ | |
| 889 ['python', 'echo', 'copy-existing-baselines-internal', '--suffix es', 'txt', | |
| 890 '--builder', 'MOCK Mac10.10', '--test', 'fast/dom/missing-text. html'], | |
| 891 ['python', 'echo', 'copy-existing-baselines-internal', '--suffix es', 'txt,png', | |
| 892 '--builder', 'MOCK Mac10.10', '--test', 'fast/dom/missing-text- and-image.html'], | |
| 893 ['python', 'echo', 'copy-existing-baselines-internal', '--suffix es', 'png', | |
| 894 '--builder', 'MOCK Mac10.10', '--test', 'fast/dom/missing-image .html'], | |
| 895 ], | |
| 896 [ | |
| 897 ['python', 'echo', 'rebaseline-test-internal', '--suffixes', 'tx t', | |
| 898 '--builder', 'MOCK Mac10.10', '--test', 'fast/dom/missing-text. html'], | |
| 899 ['python', 'echo', 'rebaseline-test-internal', '--suffixes', 'tx t,png', | |
| 900 '--builder', 'MOCK Mac10.10', '--test', 'fast/dom/missing-text- and-image.html'], | |
| 901 ['python', 'echo', 'rebaseline-test-internal', '--suffixes', 'pn g', | |
| 902 '--builder', 'MOCK Mac10.10', '--test', 'fast/dom/missing-image .html'], | |
| 903 ] | |
| 904 ]) | |
| 905 | |
| 837 | 906 |
| 838 class TestOptimizeBaselines(BaseTestCase): | 907 class TestOptimizeBaselines(BaseTestCase): |
| 839 command_constructor = OptimizeBaselines | 908 command_constructor = OptimizeBaselines |
| 840 | 909 |
| 841 def _write_test_file(self, port, path, contents): | 910 def _write_test_file(self, port, path, contents): |
| 842 abs_path = self.tool.filesystem.join(port.layout_tests_dir(), path) | 911 abs_path = self.tool.filesystem.join(port.layout_tests_dir(), path) |
| 843 self.tool.filesystem.write_text_file(abs_path, contents) | 912 self.tool.filesystem.write_text_file(abs_path, contents) |
| 844 | 913 |
| 845 def setUp(self): | 914 def setUp(self): |
| 846 super(TestOptimizeBaselines, self).setUp() | 915 super(TestOptimizeBaselines, self).setUp() |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1420 ['git', 'cl', 'upload', '-f', '--auth-refresh-token-json', RIETV ELD_REFRESH_TOKEN], | 1489 ['git', 'cl', 'upload', '-f', '--auth-refresh-token-json', RIETV ELD_REFRESH_TOKEN], |
| 1421 ['git', 'pull'], | 1490 ['git', 'pull'], |
| 1422 ['git', 'cl', 'land', '-f', '-v', '--auth-refresh-token-json', R IETVELD_REFRESH_TOKEN], | 1491 ['git', 'cl', 'land', '-f', '-v', '--auth-refresh-token-json', R IETVELD_REFRESH_TOKEN], |
| 1423 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietv eldissue'], | 1492 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietv eldissue'], |
| 1424 ], | 1493 ], |
| 1425 auth_refresh_token_json=RIETVELD_REFRESH_TOKEN) | 1494 auth_refresh_token_json=RIETVELD_REFRESH_TOKEN) |
| 1426 | 1495 |
| 1427 def test_execute_with_dry_run(self): | 1496 def test_execute_with_dry_run(self): |
| 1428 self._basic_execute_test([], dry_run=True) | 1497 self._basic_execute_test([], dry_run=True) |
| 1429 self.assertEqual(self.tool.scm().local_commits(), []) | 1498 self.assertEqual(self.tool.scm().local_commits(), []) |
| OLD | NEW |