| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 | 883 |
| 884 def test_missing_baselines(self): | 884 def test_missing_baselines(self): |
| 885 self.command.execute(MockOptions(suffixes='png,txt', missing=True, platf
orm=None), ['passes/text.html'], self.tool) | 885 self.command.execute(MockOptions(suffixes='png,txt', missing=True, platf
orm=None), ['passes/text.html'], self.tool) |
| 886 self.assertEqual(self.lines, | 886 self.assertEqual(self.lines, |
| 887 ['passes/text-expected.png: (no baselines found)', | 887 ['passes/text-expected.png: (no baselines found)', |
| 888 'passes/text-expected.txt:', | 888 'passes/text-expected.txt:', |
| 889 ' (generic): 123456']) | 889 ' (generic): 123456']) |
| 890 | 890 |
| 891 | 891 |
| 892 class TestAutoRebaseline(_BaseTestCase): | 892 class TestAutoRebaseline(_BaseTestCase): |
| 893 SVN_REMOTE_CMD = ['git', 'config', '--local', '--get-regexp', '^svn-remote\\
.'] | |
| 894 command_constructor = AutoRebaseline | 893 command_constructor = AutoRebaseline |
| 895 | 894 |
| 896 def _write_test_file(self, port, path, contents): | 895 def _write_test_file(self, port, path, contents): |
| 897 abs_path = self.tool.filesystem.join(port.layout_tests_dir(), path) | 896 abs_path = self.tool.filesystem.join(port.layout_tests_dir(), path) |
| 898 self.tool.filesystem.write_text_file(abs_path, contents) | 897 self.tool.filesystem.write_text_file(abs_path, contents) |
| 899 | 898 |
| 900 def _setup_test_port(self): | 899 def _setup_test_port(self): |
| 901 test_port = self.tool.port_factory.get('test') | 900 test_port = self.tool.port_factory.get('test') |
| 902 original_get = self.tool.port_factory.get | 901 original_get = self.tool.port_factory.get |
| 903 | 902 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 6469e754a1 path/to/TestExpectations (foobarbaz1@chromium.org 2
013-04-28 04:52:41 +0000 12) crbug.com/24182 path/to/rebaseline-new-revision.h
tml [ NeedsRebaseline ] | 937 6469e754a1 path/to/TestExpectations (foobarbaz1@chromium.org 2
013-04-28 04:52:41 +0000 12) crbug.com/24182 path/to/rebaseline-new-revision.h
tml [ NeedsRebaseline ] |
| 939 624caaaaaa path/to/TestExpectations (foo@chromium.org 2
013-04-28 04:52:41 +0000 12) crbug.com/24182 path/to/not-cycled-through-bots.h
tml [ NeedsRebaseline ] | 938 624caaaaaa path/to/TestExpectations (foo@chromium.org 2
013-04-28 04:52:41 +0000 12) crbug.com/24182 path/to/not-cycled-through-bots.h
tml [ NeedsRebaseline ] |
| 940 0000000000 path/to/TestExpectations (foo@chromium.org 2
013-04-28 04:52:41 +0000 12) crbug.com/24182 path/to/locally-changed-lined.htm
l [ NeedsRebaseline ] | 939 0000000000 path/to/TestExpectations (foo@chromium.org 2
013-04-28 04:52:41 +0000 12) crbug.com/24182 path/to/locally-changed-lined.htm
l [ NeedsRebaseline ] |
| 941 """ | 940 """ |
| 942 self.tool.scm().blame = blame | 941 self.tool.scm().blame = blame |
| 943 | 942 |
| 944 min_revision = 9000 | 943 min_revision = 9000 |
| 945 self.assertEqual(self.command.tests_to_rebaseline(self.tool, min_revisio
n, print_revisions=False), ( | 944 self.assertEqual(self.command.tests_to_rebaseline(self.tool, min_revisio
n, print_revisions=False), ( |
| 946 set(['path/to/rebaseline-without-bug-number.html', 'path/to/reba
seline-with-modifiers.html', 'path/to/rebaseline-without-modifiers.html']), | 945 set(['path/to/rebaseline-without-bug-number.html', 'path/to/reba
seline-with-modifiers.html', 'path/to/rebaseline-without-modifiers.html']), |
| 947 5678, | 946 5678, |
| 947 '624c3081c0', |
| 948 'foobarbaz1@chromium.org', | 948 'foobarbaz1@chromium.org', |
| 949 set(['24182', '234']), | 949 set(['24182', '234']), |
| 950 True)) | 950 True)) |
| 951 | 951 |
| 952 def test_tests_to_rebaseline_over_limit(self): | 952 def test_tests_to_rebaseline_over_limit(self): |
| 953 def blame(path): | 953 def blame(path): |
| 954 result = "" | 954 result = "" |
| 955 for i in range(0, self.command.MAX_LINES_TO_REBASELINE + 1): | 955 for i in range(0, self.command.MAX_LINES_TO_REBASELINE + 1): |
| 956 result += "624c3081c0 path/to/TestExpectations
(foobarbaz1@chromium.org 2013-04-28 04:52:41 +0000 13) crbug.com/24182 path/t
o/rebaseline-%s.html [ NeedsRebaseline ]\n" % i | 956 result += "624c3081c0 path/to/TestExpectations
(foobarbaz1@chromium.org 2013-04-28 04:52:41 +0000 13) crbug.com/24182 path/t
o/rebaseline-%s.html [ NeedsRebaseline ]\n" % i |
| 957 return result | 957 return result |
| 958 self.tool.scm().blame = blame | 958 self.tool.scm().blame = blame |
| 959 | 959 |
| 960 expected_list_of_tests = [] | 960 expected_list_of_tests = [] |
| 961 for i in range(0, self.command.MAX_LINES_TO_REBASELINE): | 961 for i in range(0, self.command.MAX_LINES_TO_REBASELINE): |
| 962 expected_list_of_tests.append("path/to/rebaseline-%s.html" % i) | 962 expected_list_of_tests.append("path/to/rebaseline-%s.html" % i) |
| 963 | 963 |
| 964 min_revision = 9000 | 964 min_revision = 9000 |
| 965 self.assertEqual(self.command.tests_to_rebaseline(self.tool, min_revisio
n, print_revisions=False), ( | 965 self.assertEqual(self.command.tests_to_rebaseline(self.tool, min_revisio
n, print_revisions=False), ( |
| 966 set(expected_list_of_tests), | 966 set(expected_list_of_tests), |
| 967 5678, | 967 5678, |
| 968 '624c3081c0', |
| 968 'foobarbaz1@chromium.org', | 969 'foobarbaz1@chromium.org', |
| 969 set(['24182']), | 970 set(['24182']), |
| 970 True)) | 971 True)) |
| 971 | 972 |
| 972 def test_commit_message(self): | 973 def test_commit_message(self): |
| 973 author = "foo@chromium.org" | 974 author = "foo@chromium.org" |
| 974 revision = 1234 | 975 revision = 1234 |
| 976 commit = "abcd567" |
| 975 bugs = set() | 977 bugs = set() |
| 976 self.assertEqual(self.command.commit_message(author, revision, bugs), | 978 self.assertEqual(self.command.commit_message(author, revision, commit, b
ugs), |
| 977 """Auto-rebaseline for r1234 | 979 """Auto-rebaseline for r1234 |
| 978 | 980 |
| 979 http://src.chromium.org/viewvc/blink?view=revision&revision=1234 | 981 https://chromium.googlesource.com/chromium/src/+/abcd567 |
| 980 | 982 |
| 981 TBR=foo@chromium.org | 983 TBR=foo@chromium.org |
| 982 """) | 984 """) |
| 983 | 985 |
| 984 bugs = set(["234", "345"]) | 986 bugs = set(["234", "345"]) |
| 985 self.assertEqual(self.command.commit_message(author, revision, bugs), | 987 self.assertEqual(self.command.commit_message(author, revision, commit, b
ugs), |
| 986 """Auto-rebaseline for r1234 | 988 """Auto-rebaseline for r1234 |
| 987 | 989 |
| 988 http://src.chromium.org/viewvc/blink?view=revision&revision=1234 | 990 https://chromium.googlesource.com/chromium/src/+/abcd567 |
| 989 | 991 |
| 990 BUG=234,345 | 992 BUG=234,345 |
| 991 TBR=foo@chromium.org | 993 TBR=foo@chromium.org |
| 992 """) | 994 """) |
| 993 | 995 |
| 994 def test_no_needs_rebaseline_lines(self): | 996 def test_no_needs_rebaseline_lines(self): |
| 995 def blame(path): | 997 def blame(path): |
| 996 return """ | 998 return """ |
| 997 6469e754a1 path/to/TestExpectations (foobarbaz1@chromium.org 2
013-06-14 20:18:46 +0000 11) crbug.com/24182 [ Debug ] path/to/norebaseline.ht
ml [ ImageOnlyFailure ] | 999 6469e754a1 path/to/TestExpectations (foobarbaz1@chromium.org 2
013-06-14 20:18:46 +0000 11) crbug.com/24182 [ Debug ] path/to/norebaseline.ht
ml [ ImageOnlyFailure ] |
| 998 """ | 1000 """ |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 crbug.com/24182 [ SnowLeopard ] fast/dom/prototype-strawberry.html [ NeedsRebase
line ] | 1055 crbug.com/24182 [ SnowLeopard ] fast/dom/prototype-strawberry.html [ NeedsRebase
line ] |
| 1054 crbug.com/24182 fast/dom/prototype-chocolate.html [ NeedsRebaseline ] | 1056 crbug.com/24182 fast/dom/prototype-chocolate.html [ NeedsRebaseline ] |
| 1055 crbug.com/24182 path/to/not-cycled-through-bots.html [ NeedsRebaseline ] | 1057 crbug.com/24182 path/to/not-cycled-through-bots.html [ NeedsRebaseline ] |
| 1056 crbug.com/24182 path/to/locally-changed-lined.html [ NeedsRebaseline ] | 1058 crbug.com/24182 path/to/locally-changed-lined.html [ NeedsRebaseline ] |
| 1057 """) | 1059 """) |
| 1058 | 1060 |
| 1059 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy
test contents") | 1061 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy
test contents") |
| 1060 self._write_test_file(test_port, 'fast/dom/prototype-strawberry.html', "
Dummy test contents") | 1062 self._write_test_file(test_port, 'fast/dom/prototype-strawberry.html', "
Dummy test contents") |
| 1061 self._write_test_file(test_port, 'fast/dom/prototype-chocolate.html', "D
ummy test contents") | 1063 self._write_test_file(test_port, 'fast/dom/prototype-chocolate.html', "D
ummy test contents") |
| 1062 | 1064 |
| 1063 self.tool.executive = MockLineRemovingExecutive( | 1065 self.tool.executive = MockLineRemovingExecutive() |
| 1064 should_return_zero_when_run=set(self.SVN_REMOTE_CMD)) | |
| 1065 | 1066 |
| 1066 old_exact_matches = builders._exact_matches | 1067 old_exact_matches = builders._exact_matches |
| 1067 try: | 1068 try: |
| 1068 builders._exact_matches = { | 1069 builders._exact_matches = { |
| 1069 "MOCK Leopard": {"port_name": "test-mac-leopard", "specifiers":
set(["mock-specifier"])}, | 1070 "MOCK Leopard": {"port_name": "test-mac-leopard", "specifiers":
set(["mock-specifier"])}, |
| 1070 "MOCK SnowLeopard": {"port_name": "test-mac-snowleopard", "speci
fiers": set(["mock-specifier"])}, | 1071 "MOCK SnowLeopard": {"port_name": "test-mac-snowleopard", "speci
fiers": set(["mock-specifier"])}, |
| 1071 } | 1072 } |
| 1072 | 1073 |
| 1073 self.command.tree_status = lambda: 'closed' | 1074 self.command.tree_status = lambda: 'closed' |
| 1074 self.command.execute(MockOptions(optimize=True, verbose=False, resul
ts_directory=False), [], self.tool) | 1075 self.command.execute(MockOptions(optimize=True, verbose=False, resul
ts_directory=False), [], self.tool) |
| 1075 self.assertEqual(self.tool.executive.calls, []) | 1076 self.assertEqual(self.tool.executive.calls, []) |
| 1076 | 1077 |
| 1077 self.command.tree_status = lambda: 'open' | 1078 self.command.tree_status = lambda: 'open' |
| 1078 self.tool.executive.calls = [] | 1079 self.tool.executive.calls = [] |
| 1079 self.command.execute(MockOptions(optimize=True, verbose=False, resul
ts_directory=False), [], self.tool) | 1080 self.command.execute(MockOptions(optimize=True, verbose=False, resul
ts_directory=False), [], self.tool) |
| 1080 | 1081 |
| 1081 self.assertEqual(self.tool.executive.calls, [ | 1082 self.assertEqual(self.tool.executive.calls, [ |
| 1082 self.SVN_REMOTE_CMD, | |
| 1083 [ | 1083 [ |
| 1084 ['python', 'echo', 'copy-existing-baselines-internal', '--su
ffixes', 'txt,png', '--builder', 'MOCK Leopard', '--test', 'fast/dom/prototype-c
hocolate.html'], | 1084 ['python', 'echo', 'copy-existing-baselines-internal', '--su
ffixes', 'txt,png', '--builder', 'MOCK Leopard', '--test', 'fast/dom/prototype-c
hocolate.html'], |
| 1085 ['python', 'echo', 'copy-existing-baselines-internal', '--su
ffixes', 'png', '--builder', 'MOCK SnowLeopard', '--test', 'fast/dom/prototype-s
trawberry.html'], | 1085 ['python', 'echo', 'copy-existing-baselines-internal', '--su
ffixes', 'png', '--builder', 'MOCK SnowLeopard', '--test', 'fast/dom/prototype-s
trawberry.html'], |
| 1086 ['python', 'echo', 'copy-existing-baselines-internal', '--su
ffixes', 'txt', '--builder', 'MOCK Leopard', '--test', 'fast/dom/prototype-taco.
html'], | 1086 ['python', 'echo', 'copy-existing-baselines-internal', '--su
ffixes', 'txt', '--builder', 'MOCK Leopard', '--test', 'fast/dom/prototype-taco.
html'], |
| 1087 ['python', 'echo', 'copy-existing-baselines-internal', '--su
ffixes', 'txt', '--builder', 'MOCK SnowLeopard', '--test', 'fast/dom/prototype-t
aco.html'], | 1087 ['python', 'echo', 'copy-existing-baselines-internal', '--su
ffixes', 'txt', '--builder', 'MOCK SnowLeopard', '--test', 'fast/dom/prototype-t
aco.html'], |
| 1088 ], | 1088 ], |
| 1089 [ | 1089 [ |
| 1090 ['python', 'echo', 'rebaseline-test-internal', '--suffixes',
'txt,png', '--builder', 'MOCK Leopard', '--test', 'fast/dom/prototype-chocolate
.html'], | 1090 ['python', 'echo', 'rebaseline-test-internal', '--suffixes',
'txt,png', '--builder', 'MOCK Leopard', '--test', 'fast/dom/prototype-chocolate
.html'], |
| 1091 ['python', 'echo', 'rebaseline-test-internal', '--suffixes',
'png', '--builder', 'MOCK SnowLeopard', '--test', 'fast/dom/prototype-strawberr
y.html'], | 1091 ['python', 'echo', 'rebaseline-test-internal', '--suffixes',
'png', '--builder', 'MOCK SnowLeopard', '--test', 'fast/dom/prototype-strawberr
y.html'], |
| 1092 ['python', 'echo', 'rebaseline-test-internal', '--suffixes',
'txt', '--builder', 'MOCK Leopard', '--test', 'fast/dom/prototype-taco.html'], | 1092 ['python', 'echo', 'rebaseline-test-internal', '--suffixes',
'txt', '--builder', 'MOCK Leopard', '--test', 'fast/dom/prototype-taco.html'], |
| 1093 ['python', 'echo', 'rebaseline-test-internal', '--suffixes',
'txt', '--builder', 'MOCK SnowLeopard', '--test', 'fast/dom/prototype-taco.html
'], | 1093 ['python', 'echo', 'rebaseline-test-internal', '--suffixes',
'txt', '--builder', 'MOCK SnowLeopard', '--test', 'fast/dom/prototype-taco.html
'], |
| 1094 ], | 1094 ], |
| 1095 [ | 1095 [ |
| 1096 ['python', 'echo', 'optimize-baselines', '--no-modify-scm',
'--suffixes', 'txt,png', 'fast/dom/prototype-chocolate.html'], | 1096 ['python', 'echo', 'optimize-baselines', '--no-modify-scm',
'--suffixes', 'txt,png', 'fast/dom/prototype-chocolate.html'], |
| 1097 ['python', 'echo', 'optimize-baselines', '--no-modify-scm',
'--suffixes', 'png', 'fast/dom/prototype-strawberry.html'], | 1097 ['python', 'echo', 'optimize-baselines', '--no-modify-scm',
'--suffixes', 'png', 'fast/dom/prototype-strawberry.html'], |
| 1098 ['python', 'echo', 'optimize-baselines', '--no-modify-scm',
'--suffixes', 'txt', 'fast/dom/prototype-taco.html'], | 1098 ['python', 'echo', 'optimize-baselines', '--no-modify-scm',
'--suffixes', 'txt', 'fast/dom/prototype-taco.html'], |
| 1099 ], | 1099 ], |
| 1100 ['git', 'cl', 'upload', '-f'], | 1100 ['git', 'cl', 'upload', '-f'], |
| 1101 ['git', 'pull'], | 1101 ['git', 'pull'], |
| 1102 ['git', 'cl', 'dcommit', '-f'], | 1102 ['git', 'cl', 'dcommit', '-f'], |
| 1103 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietv
eldissue'], | 1103 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietv
eldissue'], |
| 1104 ['git', 'cl', 'set_close'], | |
| 1105 ]) | 1104 ]) |
| 1106 | 1105 |
| 1107 # The mac ports should both be removed since they're the only ones i
n builders._exact_matches. | 1106 # The mac ports should both be removed since they're the only ones i
n builders._exact_matches. |
| 1108 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_
to_generic_test_expectations_file()), """ | 1107 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_
to_generic_test_expectations_file()), """ |
| 1109 crbug.com/24182 [ Debug ] path/to/norebaseline.html [ Rebaseline ] | 1108 crbug.com/24182 [ Debug ] path/to/norebaseline.html [ Rebaseline ] |
| 1110 Bug(foo) [ Linux Win ] fast/dom/prototype-taco.html [ NeedsRebaseline ] | 1109 Bug(foo) [ Linux Win ] fast/dom/prototype-taco.html [ NeedsRebaseline ] |
| 1111 crbug.com/24182 [ Linux Win ] fast/dom/prototype-chocolate.html [ NeedsRebaselin
e ] | 1110 crbug.com/24182 [ Linux Win ] fast/dom/prototype-chocolate.html [ NeedsRebaselin
e ] |
| 1112 crbug.com/24182 path/to/not-cycled-through-bots.html [ NeedsRebaseline ] | 1111 crbug.com/24182 path/to/not-cycled-through-bots.html [ NeedsRebaseline ] |
| 1113 crbug.com/24182 path/to/locally-changed-lined.html [ NeedsRebaseline ] | 1112 crbug.com/24182 path/to/locally-changed-lined.html [ NeedsRebaseline ] |
| 1114 """) | 1113 """) |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy
test contents") | 1152 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy
test contents") |
| 1154 | 1153 |
| 1155 old_exact_matches = builders._exact_matches | 1154 old_exact_matches = builders._exact_matches |
| 1156 try: | 1155 try: |
| 1157 builders._exact_matches = { | 1156 builders._exact_matches = { |
| 1158 "MOCK SnowLeopard": {"port_name": "test-mac-snowleopard", "speci
fiers": set(["mock-specifier"])}, | 1157 "MOCK SnowLeopard": {"port_name": "test-mac-snowleopard", "speci
fiers": set(["mock-specifier"])}, |
| 1159 } | 1158 } |
| 1160 | 1159 |
| 1161 self.command.SECONDS_BEFORE_GIVING_UP = 0 | 1160 self.command.SECONDS_BEFORE_GIVING_UP = 0 |
| 1162 self.command.tree_status = lambda: 'open' | 1161 self.command.tree_status = lambda: 'open' |
| 1163 self.tool.executive = MockExecutive( | 1162 self.tool.executive = MockExecutive() |
| 1164 should_return_zero_when_run=set(self.SVN_REMOTE_CMD)) | |
| 1165 self.tool.executive.calls = [] | 1163 self.tool.executive.calls = [] |
| 1166 self.command.execute(MockOptions(optimize=True, verbose=False, resul
ts_directory=False), [], self.tool) | 1164 self.command.execute(MockOptions(optimize=True, verbose=False, resul
ts_directory=False), [], self.tool) |
| 1167 | 1165 |
| 1168 self.assertEqual(self.tool.executive.calls, [ | 1166 self.assertEqual(self.tool.executive.calls, [ |
| 1169 self.SVN_REMOTE_CMD, | |
| 1170 [ | 1167 [ |
| 1171 ['python', 'echo', 'copy-existing-baselines-internal', '--su
ffixes', 'txt', '--builder', 'MOCK SnowLeopard', '--test', 'fast/dom/prototype-t
aco.html'], | 1168 ['python', 'echo', 'copy-existing-baselines-internal', '--su
ffixes', 'txt', '--builder', 'MOCK SnowLeopard', '--test', 'fast/dom/prototype-t
aco.html'], |
| 1172 ], | 1169 ], |
| 1173 [ | 1170 [ |
| 1174 ['python', 'echo', 'rebaseline-test-internal', '--suffixes',
'txt', '--builder', 'MOCK SnowLeopard', '--test', 'fast/dom/prototype-taco.html
'], | 1171 ['python', 'echo', 'rebaseline-test-internal', '--suffixes',
'txt', '--builder', 'MOCK SnowLeopard', '--test', 'fast/dom/prototype-taco.html
'], |
| 1175 ], | 1172 ], |
| 1176 [['python', 'echo', 'optimize-baselines', '--no-modify-scm', '--
suffixes', 'txt', 'fast/dom/prototype-taco.html']], | 1173 [['python', 'echo', 'optimize-baselines', '--no-modify-scm', '--
suffixes', 'txt', 'fast/dom/prototype-taco.html']], |
| 1177 ['git', 'cl', 'upload', '-f'], | 1174 ['git', 'cl', 'upload', '-f'], |
| 1178 ]) | 1175 ]) |
| 1179 finally: | 1176 finally: |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1207 return self.command._builder_data | 1204 return self.command._builder_data |
| 1208 | 1205 |
| 1209 self.command.builder_data = builder_data | 1206 self.command.builder_data = builder_data |
| 1210 | 1207 |
| 1211 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe
ctations_file(), """ | 1208 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe
ctations_file(), """ |
| 1212 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] | 1209 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] |
| 1213 """) | 1210 """) |
| 1214 | 1211 |
| 1215 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy
test contents") | 1212 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy
test contents") |
| 1216 | 1213 |
| 1217 self.tool.executive = MockLineRemovingExecutive( | 1214 self.tool.executive = MockLineRemovingExecutive() |
| 1218 should_return_zero_when_run=set(self.SVN_REMOTE_CMD)) | |
| 1219 | 1215 |
| 1220 old_exact_matches = builders._exact_matches | 1216 old_exact_matches = builders._exact_matches |
| 1221 try: | 1217 try: |
| 1222 builders._exact_matches = { | 1218 builders._exact_matches = { |
| 1223 "MOCK Leopard": {"port_name": "test-mac-leopard", "specifiers":
set(["mock-specifier"])}, | 1219 "MOCK Leopard": {"port_name": "test-mac-leopard", "specifiers":
set(["mock-specifier"])}, |
| 1224 "MOCK SnowLeopard": {"port_name": "test-mac-snowleopard", "speci
fiers": set(["mock-specifier"])}, | 1220 "MOCK SnowLeopard": {"port_name": "test-mac-snowleopard", "speci
fiers": set(["mock-specifier"])}, |
| 1225 } | 1221 } |
| 1226 | 1222 |
| 1227 self.command.tree_status = lambda: 'open' | 1223 self.command.tree_status = lambda: 'open' |
| 1228 self.command.execute(MockOptions(optimize=True, verbose=False, resul
ts_directory=False), [], self.tool) | 1224 self.command.execute(MockOptions(optimize=True, verbose=False, resul
ts_directory=False), [], self.tool) |
| 1229 self.assertEqual(self.tool.executive.calls, [ | 1225 self.assertEqual(self.tool.executive.calls, [ |
| 1230 self.SVN_REMOTE_CMD, | |
| 1231 [['python', 'echo', 'optimize-baselines', '--no-modify-scm', '--
suffixes', '', 'fast/dom/prototype-taco.html']], | 1226 [['python', 'echo', 'optimize-baselines', '--no-modify-scm', '--
suffixes', '', 'fast/dom/prototype-taco.html']], |
| 1232 ['git', 'cl', 'upload', '-f'], | 1227 ['git', 'cl', 'upload', '-f'], |
| 1233 ['git', 'pull'], | 1228 ['git', 'pull'], |
| 1234 ['git', 'cl', 'dcommit', '-f'], | 1229 ['git', 'cl', 'dcommit', '-f'], |
| 1235 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietv
eldissue'], | 1230 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietv
eldissue'], |
| 1236 ['git', 'cl', 'set_close'], | |
| 1237 ]) | 1231 ]) |
| 1238 | 1232 |
| 1239 # The mac ports should both be removed since they're the only ones i
n builders._exact_matches. | 1233 # The mac ports should both be removed since they're the only ones i
n builders._exact_matches. |
| 1240 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_
to_generic_test_expectations_file()), """ | 1234 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_
to_generic_test_expectations_file()), """ |
| 1241 Bug(foo) [ Linux Win ] fast/dom/prototype-taco.html [ NeedsRebaseline ] | 1235 Bug(foo) [ Linux Win ] fast/dom/prototype-taco.html [ NeedsRebaseline ] |
| 1242 """) | 1236 """) |
| 1243 finally: | 1237 finally: |
| 1244 builders._exact_matches = old_exact_matches | 1238 builders._exact_matches = old_exact_matches |
| 1245 | 1239 |
| 1246 def test_execute_setup_git_svn(self): | |
| 1247 def blame(path): | |
| 1248 return """ | |
| 1249 6469e754a1 path/to/TestExpectations (foobarbaz1@chromium.org 2
013-04-28 04:52:41 +0000 13) Bug(foo) fast/dom/prototype-taco.html [ NeedsReba
seline ] | |
| 1250 """ | |
| 1251 self.tool.scm().blame = blame | |
| 1252 | |
| 1253 test_port = self._setup_test_port() | |
| 1254 | |
| 1255 old_builder_data = self.command.builder_data | |
| 1256 | |
| 1257 def builder_data(): | |
| 1258 self.command._builder_data['MOCK Win'] = LayoutTestResults.results_f
rom_string("""ADD_RESULTS({ | |
| 1259 "tests": { | |
| 1260 "fast": { | |
| 1261 "dom": { | |
| 1262 "prototype-taco.html": { | |
| 1263 "expected": "FAIL", | |
| 1264 "actual": "PASS", | |
| 1265 "is_unexpected": true | |
| 1266 } | |
| 1267 } | |
| 1268 } | |
| 1269 } | |
| 1270 });""") | |
| 1271 return self.command._builder_data | |
| 1272 | |
| 1273 self.command.builder_data = builder_data | |
| 1274 | |
| 1275 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe
ctations_file(), """ | |
| 1276 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] | |
| 1277 """) | |
| 1278 | |
| 1279 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy
test contents") | |
| 1280 | |
| 1281 self.tool.executive = MockLineRemovingExecutive() | |
| 1282 | |
| 1283 old_exact_matches = builders._exact_matches | |
| 1284 try: | |
| 1285 builders._exact_matches = { | |
| 1286 "MOCK Win": {"port_name": "test-win-win7", "specifiers": set(["m
ock-specifier"])}, | |
| 1287 } | |
| 1288 | |
| 1289 self.command.tree_status = lambda: 'open' | |
| 1290 self.command.execute(MockOptions(optimize=True, verbose=False, resul
ts_directory=False), [], self.tool) | |
| 1291 self.assertEqual(self.tool.executive.calls, [ | |
| 1292 self.SVN_REMOTE_CMD, | |
| 1293 ['git', 'auto-svn'], | |
| 1294 [['python', 'echo', 'optimize-baselines', '--no-modify-scm', '--
suffixes', '', 'fast/dom/prototype-taco.html']], | |
| 1295 ['git', 'cl', 'upload', '-f'], | |
| 1296 ['git', 'pull'], | |
| 1297 ['git', 'cl', 'dcommit', '-f'], | |
| 1298 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietv
eldissue'], | |
| 1299 ]) | |
| 1300 | |
| 1301 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_
to_generic_test_expectations_file()), """ | |
| 1302 Bug(foo) [ Linux Mac XP ] fast/dom/prototype-taco.html [ NeedsRebaseline ] | |
| 1303 """) | |
| 1304 finally: | |
| 1305 builders._exact_matches = old_exact_matches | |
| 1306 | |
| 1307 def test_execute_use_alternate_rebaseline_branch(self): | 1240 def test_execute_use_alternate_rebaseline_branch(self): |
| 1308 def blame(path): | 1241 def blame(path): |
| 1309 return """ | 1242 return """ |
| 1310 6469e754a1 path/to/TestExpectations (foobarbaz1@chromium.org 2
013-04-28 04:52:41 +0000 13) Bug(foo) fast/dom/prototype-taco.html [ NeedsReba
seline ] | 1243 6469e754a1 path/to/TestExpectations (foobarbaz1@chromium.org 2
013-04-28 04:52:41 +0000 13) Bug(foo) fast/dom/prototype-taco.html [ NeedsReba
seline ] |
| 1311 """ | 1244 """ |
| 1312 self.tool.scm().blame = blame | 1245 self.tool.scm().blame = blame |
| 1313 | 1246 |
| 1314 test_port = self._setup_test_port() | 1247 test_port = self._setup_test_port() |
| 1315 | 1248 |
| 1316 old_builder_data = self.command.builder_data | 1249 old_builder_data = self.command.builder_data |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1332 return self.command._builder_data | 1265 return self.command._builder_data |
| 1333 | 1266 |
| 1334 self.command.builder_data = builder_data | 1267 self.command.builder_data = builder_data |
| 1335 | 1268 |
| 1336 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe
ctations_file(), """ | 1269 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe
ctations_file(), """ |
| 1337 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] | 1270 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] |
| 1338 """) | 1271 """) |
| 1339 | 1272 |
| 1340 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy
test contents") | 1273 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy
test contents") |
| 1341 | 1274 |
| 1342 self.tool.executive = MockLineRemovingExecutive( | 1275 self.tool.executive = MockLineRemovingExecutive() |
| 1343 should_return_zero_when_run=set(self.SVN_REMOTE_CMD)) | |
| 1344 | 1276 |
| 1345 old_exact_matches = builders._exact_matches | 1277 old_exact_matches = builders._exact_matches |
| 1346 try: | 1278 try: |
| 1347 builders._exact_matches = { | 1279 builders._exact_matches = { |
| 1348 "MOCK Win": {"port_name": "test-win-win7", "specifiers": set(["m
ock-specifier"])}, | 1280 "MOCK Win": {"port_name": "test-win-win7", "specifiers": set(["m
ock-specifier"])}, |
| 1349 } | 1281 } |
| 1350 | 1282 |
| 1351 self.command.tree_status = lambda: 'open' | 1283 self.command.tree_status = lambda: 'open' |
| 1352 webkitpy.tool.commands.rebaseline._get_branch_name_or_ref = lambda x
: 'auto-rebaseline-temporary-branch' | 1284 webkitpy.tool.commands.rebaseline._get_branch_name_or_ref = lambda x
: 'auto-rebaseline-temporary-branch' |
| 1353 self.command.execute(MockOptions(optimize=True, verbose=False, resul
ts_directory=False), [], self.tool) | 1285 self.command.execute(MockOptions(optimize=True, verbose=False, resul
ts_directory=False), [], self.tool) |
| 1354 self.assertEqual(self.tool.executive.calls, [ | 1286 self.assertEqual(self.tool.executive.calls, [ |
| 1355 self.SVN_REMOTE_CMD, | |
| 1356 [['python', 'echo', 'optimize-baselines', '--no-modify-scm', '--
suffixes', '', 'fast/dom/prototype-taco.html']], | 1287 [['python', 'echo', 'optimize-baselines', '--no-modify-scm', '--
suffixes', '', 'fast/dom/prototype-taco.html']], |
| 1357 ['git', 'cl', 'upload', '-f'], | 1288 ['git', 'cl', 'upload', '-f'], |
| 1358 ['git', 'pull'], | 1289 ['git', 'pull'], |
| 1359 ['git', 'cl', 'dcommit', '-f'], | 1290 ['git', 'cl', 'dcommit', '-f'], |
| 1360 ['git', 'config', 'branch.auto-rebaseline-alt-temporary-branch.r
ietveldissue'], | 1291 ['git', 'config', 'branch.auto-rebaseline-alt-temporary-branch.r
ietveldissue'], |
| 1361 ['git', 'cl', 'set_close'], | |
| 1362 ]) | 1292 ]) |
| 1363 | 1293 |
| 1364 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_
to_generic_test_expectations_file()), """ | 1294 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_
to_generic_test_expectations_file()), """ |
| 1365 Bug(foo) [ Linux Mac XP ] fast/dom/prototype-taco.html [ NeedsRebaseline ] | 1295 Bug(foo) [ Linux Mac XP ] fast/dom/prototype-taco.html [ NeedsRebaseline ] |
| 1366 """) | 1296 """) |
| 1367 finally: | 1297 finally: |
| 1368 builders._exact_matches = old_exact_matches | 1298 builders._exact_matches = old_exact_matches |
| 1369 | 1299 |
| 1370 def test_execute_stuck_on_alternate_rebaseline_branch(self): | 1300 def test_execute_stuck_on_alternate_rebaseline_branch(self): |
| 1371 def blame(path): | 1301 def blame(path): |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1395 return self.command._builder_data | 1325 return self.command._builder_data |
| 1396 | 1326 |
| 1397 self.command.builder_data = builder_data | 1327 self.command.builder_data = builder_data |
| 1398 | 1328 |
| 1399 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe
ctations_file(), """ | 1329 self.tool.filesystem.write_text_file(test_port.path_to_generic_test_expe
ctations_file(), """ |
| 1400 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] | 1330 Bug(foo) fast/dom/prototype-taco.html [ NeedsRebaseline ] |
| 1401 """) | 1331 """) |
| 1402 | 1332 |
| 1403 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy
test contents") | 1333 self._write_test_file(test_port, 'fast/dom/prototype-taco.html', "Dummy
test contents") |
| 1404 | 1334 |
| 1405 self.tool.executive = MockLineRemovingExecutive( | 1335 self.tool.executive = MockLineRemovingExecutive() |
| 1406 should_return_zero_when_run=set(self.SVN_REMOTE_CMD)) | |
| 1407 | 1336 |
| 1408 old_exact_matches = builders._exact_matches | 1337 old_exact_matches = builders._exact_matches |
| 1409 try: | 1338 try: |
| 1410 builders._exact_matches = { | 1339 builders._exact_matches = { |
| 1411 "MOCK Win": {"port_name": "test-win-win7", "specifiers": set(["m
ock-specifier"])}, | 1340 "MOCK Win": {"port_name": "test-win-win7", "specifiers": set(["m
ock-specifier"])}, |
| 1412 } | 1341 } |
| 1413 | 1342 |
| 1414 self.command.tree_status = lambda: 'open' | 1343 self.command.tree_status = lambda: 'open' |
| 1415 webkitpy.tool.commands.rebaseline._get_branch_name_or_ref = lambda x
: 'auto-rebaseline-alt-temporary-branch' | 1344 webkitpy.tool.commands.rebaseline._get_branch_name_or_ref = lambda x
: 'auto-rebaseline-alt-temporary-branch' |
| 1416 self.command.execute(MockOptions(optimize=True, verbose=False, resul
ts_directory=False), [], self.tool) | 1345 self.command.execute(MockOptions(optimize=True, verbose=False, resul
ts_directory=False), [], self.tool) |
| 1417 self.assertEqual(self.tool.executive.calls, [ | 1346 self.assertEqual(self.tool.executive.calls, [ |
| 1418 self.SVN_REMOTE_CMD, | |
| 1419 [['python', 'echo', 'optimize-baselines', '--no-modify-scm', '--
suffixes', '', 'fast/dom/prototype-taco.html']], | 1347 [['python', 'echo', 'optimize-baselines', '--no-modify-scm', '--
suffixes', '', 'fast/dom/prototype-taco.html']], |
| 1420 ['git', 'cl', 'upload', '-f'], | 1348 ['git', 'cl', 'upload', '-f'], |
| 1421 ['git', 'pull'], | 1349 ['git', 'pull'], |
| 1422 ['git', 'cl', 'dcommit', '-f'], | 1350 ['git', 'cl', 'dcommit', '-f'], |
| 1423 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietv
eldissue'], | 1351 ['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietv
eldissue'], |
| 1424 ['git', 'cl', 'set_close'], | |
| 1425 ]) | 1352 ]) |
| 1426 | 1353 |
| 1427 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_
to_generic_test_expectations_file()), """ | 1354 self.assertEqual(self.tool.filesystem.read_text_file(test_port.path_
to_generic_test_expectations_file()), """ |
| 1428 Bug(foo) [ Linux Mac XP ] fast/dom/prototype-taco.html [ NeedsRebaseline ] | 1355 Bug(foo) [ Linux Mac XP ] fast/dom/prototype-taco.html [ NeedsRebaseline ] |
| 1429 """) | 1356 """) |
| 1430 finally: | 1357 finally: |
| 1431 builders._exact_matches = old_exact_matches | 1358 builders._exact_matches = old_exact_matches |
| 1432 | 1359 |
| 1433 | 1360 |
| 1434 class TestRebaselineOMatic(_BaseTestCase): | 1361 class TestRebaselineOMatic(_BaseTestCase): |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1472 oc.capture_output() | 1399 oc.capture_output() |
| 1473 self.command._do_one_rebaseline() | 1400 self.command._do_one_rebaseline() |
| 1474 out, _, _ = oc.restore_output() | 1401 out, _, _ = oc.restore_output() |
| 1475 | 1402 |
| 1476 self.assertEqual(out, 'MOCK STDOUT\n') | 1403 self.assertEqual(out, 'MOCK STDOUT\n') |
| 1477 self.assertEqual(self.tool.executive.calls, [ | 1404 self.assertEqual(self.tool.executive.calls, [ |
| 1478 ['git', 'pull'], | 1405 ['git', 'pull'], |
| 1479 ['/mock-checkout/third_party/WebKit/Tools/Scripts/webkit-patch', 'au
to-rebaseline', '--verbose'], | 1406 ['/mock-checkout/third_party/WebKit/Tools/Scripts/webkit-patch', 'au
to-rebaseline', '--verbose'], |
| 1480 ]) | 1407 ]) |
| 1481 self.assertEqual(self._logs, ['MOCK STDOUT']) | 1408 self.assertEqual(self._logs, ['MOCK STDOUT']) |
| OLD | NEW |