Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl_unittest.py

Issue 2605103002: Add example cases in unit tests for tests with "Slow" expectations. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 json 5 import json
6 import optparse 6 import optparse
7 7
8 from webkitpy.common.net.buildbot import Build 8 from webkitpy.common.net.buildbot import Build
9 from webkitpy.common.net.git_cl import GitCL 9 from webkitpy.common.net.git_cl import GitCL
10 from webkitpy.common.net.layout_test_results import LayoutTestResults 10 from webkitpy.common.net.layout_test_results import LayoutTestResults
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 'prototype-crashy.html': { 85 'prototype-crashy.html': {
86 'expected': 'PASS', 86 'expected': 'PASS',
87 'actual': 'CRASH', 87 'actual': 'CRASH',
88 'is_unexpected': True, 88 'is_unexpected': True,
89 }, 89 },
90 'prototype-newtest.html': { 90 'prototype-newtest.html': {
91 'expected': 'PASS', 91 'expected': 'PASS',
92 'actual': 'MISSING', 92 'actual': 'MISSING',
93 'is_unexpected': True, 93 'is_unexpected': True,
94 'is_missing_text': True, 94 'is_missing_text': True,
95 } 95 },
96 'prototype-slowtest.html': {
97 'expected': 'SLOW',
98 'actual': 'TEXT',
99 'is_unexpected': True,
100 },
96 } 101 }
97 }, 102 },
98 'svg': { 103 'svg': {
99 'dynamic-updates': { 104 'dynamic-updates': {
100 'SVGFEDropShadowElement-dom-stdDeviation-attr.html': { 105 'SVGFEDropShadowElement-dom-stdDeviation-attr.html': {
101 'expected': 'PASS', 106 'expected': 'PASS',
102 'actual': 'IMAGE', 107 'actual': 'IMAGE',
103 'has_stderr': True, 108 'has_stderr': True,
104 'is_unexpected': True, 109 'is_unexpected': True,
105 } 110 }
106 } 111 }
107 } 112 }
108 } 113 }
109 }) 114 })
110 for build in [Build('MOCK Try Win', 5000), Build('MOCK Try Mac', 4000)]: 115 for build in [Build('MOCK Try Win', 5000), Build('MOCK Try Mac', 4000)]:
111 self.tool.buildbot.set_results(build, layout_test_results) 116 self.tool.buildbot.set_results(build, layout_test_results)
112 117
113 self.tool.buildbot.set_retry_sumary_json(Build('MOCK Try Win', 5000), js on.dumps({ 118 self.tool.buildbot.set_retry_sumary_json(Build('MOCK Try Win', 5000), js on.dumps({
114 'failures': [ 119 'failures': [
120 'fast/dom/prototype-inheritance.html',
115 'fast/dom/prototype-newtest.html', 121 'fast/dom/prototype-newtest.html',
122 'fast/dom/prototype-slowtest.html',
116 'fast/dom/prototype-taco.html', 123 'fast/dom/prototype-taco.html',
117 'fast/dom/prototype-inheritance.html',
118 'svg/dynamic-updates/SVGFEDropShadowElement-dom-stdDeviation-att r.html', 124 'svg/dynamic-updates/SVGFEDropShadowElement-dom-stdDeviation-att r.html',
119 ], 125 ],
120 'ignored': [], 126 'ignored': [],
121 })) 127 }))
122 128
123 # Write to the mock filesystem so that these tests are considered to exi st. 129 # Write to the mock filesystem so that these tests are considered to exi st.
124 port = self.mac_port 130 port = self.mac_port
125 tests = [ 131 tests = [
126 'fast/dom/prototype-taco.html', 132 'fast/dom/prototype-taco.html',
127 'fast/dom/prototype-inheritance.html', 133 'fast/dom/prototype-inheritance.html',
(...skipping 19 matching lines...) Expand all
147 'trigger_jobs': False, 153 'trigger_jobs': False,
148 } 154 }
149 options.update(kwargs) 155 options.update(kwargs)
150 return optparse.Values(dict(**options)) 156 return optparse.Values(dict(**options))
151 157
152 def test_execute_with_issue_number_given(self): 158 def test_execute_with_issue_number_given(self):
153 self.command.execute(self.command_options(issue=11112222), [], self.tool ) 159 self.command.execute(self.command_options(issue=11112222), [], self.tool )
154 self.assertLog([ 160 self.assertLog([
155 'INFO: Rebaselining fast/dom/prototype-inheritance.html\n', 161 'INFO: Rebaselining fast/dom/prototype-inheritance.html\n',
156 'INFO: Rebaselining fast/dom/prototype-newtest.html\n', 162 'INFO: Rebaselining fast/dom/prototype-newtest.html\n',
163 'INFO: Rebaselining fast/dom/prototype-slowtest.html\n',
157 'INFO: Rebaselining fast/dom/prototype-taco.html\n', 164 'INFO: Rebaselining fast/dom/prototype-taco.html\n',
158 'INFO: Rebaselining svg/dynamic-updates/SVGFEDropShadowElement-dom-s tdDeviation-attr.html\n', 165 'INFO: Rebaselining svg/dynamic-updates/SVGFEDropShadowElement-dom-s tdDeviation-attr.html\n',
159 ]) 166 ])
160 167
161 def test_execute_with_no_issue_number(self): 168 def test_execute_with_no_issue_number(self):
162 self.command.execute(self.command_options(), [], self.tool) 169 self.command.execute(self.command_options(), [], self.tool)
163 self.assertLog(['ERROR: No issue number given and no issue for current b ranch. This tool requires a CL\n' 170 self.assertLog(['ERROR: No issue number given and no issue for current b ranch. This tool requires a CL\n'
164 'to operate on; please run `git cl upload` on this branc h first, or use the --issue\n' 171 'to operate on; please run `git cl upload` on this branc h first, or use the --issue\n'
165 'option to download baselines for another existing CL.\n ']) 172 'option to download baselines for another existing CL.\n '])
166 173
167 def test_execute_with_issue_number_from_branch(self): 174 def test_execute_with_issue_number_from_branch(self):
168 git_cl = GitCL(self.tool) 175 git_cl = GitCL(self.tool)
169 git_cl.get_issue_number = lambda: '11112222' 176 git_cl.get_issue_number = lambda: '11112222'
170 self.command.git_cl = lambda: git_cl 177 self.command.git_cl = lambda: git_cl
171 self.command.execute(self.command_options(), [], self.tool) 178 self.command.execute(self.command_options(), [], self.tool)
172 self.assertLog([ 179 self.assertLog([
173 'INFO: Rebaselining fast/dom/prototype-inheritance.html\n', 180 'INFO: Rebaselining fast/dom/prototype-inheritance.html\n',
174 'INFO: Rebaselining fast/dom/prototype-newtest.html\n', 181 'INFO: Rebaselining fast/dom/prototype-newtest.html\n',
182 'INFO: Rebaselining fast/dom/prototype-slowtest.html\n',
175 'INFO: Rebaselining fast/dom/prototype-taco.html\n', 183 'INFO: Rebaselining fast/dom/prototype-taco.html\n',
176 'INFO: Rebaselining svg/dynamic-updates/SVGFEDropShadowElement-dom-s tdDeviation-attr.html\n', 184 'INFO: Rebaselining svg/dynamic-updates/SVGFEDropShadowElement-dom-s tdDeviation-attr.html\n',
177 ]) 185 ])
178 186
179 def test_execute_with_only_changed_tests_option(self): 187 def test_execute_with_only_changed_tests_option(self):
180 self.command.execute(self.command_options(issue=11112222, only_changed_t ests=True), [], self.tool) 188 self.command.execute(self.command_options(issue=11112222, only_changed_t ests=True), [], self.tool)
181 # svg/dynamic-updates/SVGFEDropShadowElement-dom-stdDeviation-attr.html 189 # svg/dynamic-updates/SVGFEDropShadowElement-dom-stdDeviation-attr.html
182 # is in the list of failed tests, but not in the list of files modified 190 # is in the list of failed tests, but not in the list of files modified
183 # in the given CL; it should be included because all_tests is set to Tru e. 191 # in the given CL; it should be included because all_tests is set to Tru e.
184 self.assertLog([ 192 self.assertLog([
(...skipping 24 matching lines...) Expand all
209 # svg/dynamic-updates/SVGFEDropShadowElement-dom-stdDeviation-attr.html 217 # svg/dynamic-updates/SVGFEDropShadowElement-dom-stdDeviation-attr.html
210 # failed both with and without the patch in the try job, so it is not 218 # failed both with and without the patch in the try job, so it is not
211 # rebaselined. 219 # rebaselined.
212 self.tool.buildbot.set_retry_sumary_json( 220 self.tool.buildbot.set_retry_sumary_json(
213 Build('MOCK Try Win', 5000), None) 221 Build('MOCK Try Win', 5000), None)
214 self.command.execute(self.command_options(issue=11112222), [], self.tool ) 222 self.command.execute(self.command_options(issue=11112222), [], self.tool )
215 self.assertLog([ 223 self.assertLog([
216 'WARNING: No retry summary available for build Build(builder_name=u\ 'MOCK Try Win\', build_number=5000).\n', 224 'WARNING: No retry summary available for build Build(builder_name=u\ 'MOCK Try Win\', build_number=5000).\n',
217 'INFO: Rebaselining fast/dom/prototype-inheritance.html\n', 225 'INFO: Rebaselining fast/dom/prototype-inheritance.html\n',
218 'INFO: Rebaselining fast/dom/prototype-newtest.html\n', 226 'INFO: Rebaselining fast/dom/prototype-newtest.html\n',
227 'INFO: Rebaselining fast/dom/prototype-slowtest.html\n',
219 'INFO: Rebaselining fast/dom/prototype-taco.html\n', 228 'INFO: Rebaselining fast/dom/prototype-taco.html\n',
220 'INFO: Rebaselining svg/dynamic-updates/SVGFEDropShadowElement-dom-s tdDeviation-attr.html\n', 229 'INFO: Rebaselining svg/dynamic-updates/SVGFEDropShadowElement-dom-s tdDeviation-attr.html\n',
221 ]) 230 ])
222 231
223 def test_execute_with_trigger_jobs_option(self): 232 def test_execute_with_trigger_jobs_option(self):
224 self.command.execute(self.command_options(issue=11112222, trigger_jobs=T rue), [], self.tool) 233 self.command.execute(self.command_options(issue=11112222, trigger_jobs=T rue), [], self.tool)
225 self.assertLog([ 234 self.assertLog([
226 'INFO: Triggering try jobs for:\n', 235 'INFO: Triggering try jobs for:\n',
227 'INFO: MOCK Try Linux\n', 236 'INFO: MOCK Try Linux\n',
228 'INFO: Please re-run webkit-patch rebaseline-cl once all pending try jobs have finished.\n', 237 'INFO: Please re-run webkit-patch rebaseline-cl once all pending try jobs have finished.\n',
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 ]) 310 ])
302 311
303 def test_bails_when_there_are_unstaged_baselines(self): 312 def test_bails_when_there_are_unstaged_baselines(self):
304 scm = self.tool.scm() 313 scm = self.tool.scm()
305 scm.unstaged_changes = lambda: {'third_party/WebKit/LayoutTests/my-test- expected.txt': '?'} 314 scm.unstaged_changes = lambda: {'third_party/WebKit/LayoutTests/my-test- expected.txt': '?'}
306 self.command.execute(self.command_options(issue=11112222), [], self.tool ) 315 self.command.execute(self.command_options(issue=11112222), [], self.tool )
307 self.assertLog([ 316 self.assertLog([
308 'ERROR: Aborting: there are unstaged baselines:\n', 317 'ERROR: Aborting: there are unstaged baselines:\n',
309 'ERROR: /mock-checkout/third_party/WebKit/LayoutTests/my-test-expe cted.txt\n', 318 'ERROR: /mock-checkout/third_party/WebKit/LayoutTests/my-test-expe cted.txt\n',
310 ]) 319 ])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698