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

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

Issue 2692423005: rebaseline-cl: Get latest try jobs using git-cl when no --issue given. (Closed)
Patch Set: Rebased Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 def test_execute_with_no_issue_number(self): 169 def test_execute_with_no_issue_number(self):
170 return_code = self.command.execute(self.command_options(), [], self.tool ) 170 return_code = self.command.execute(self.command_options(), [], self.tool )
171 self.assertEqual(return_code, 1) 171 self.assertEqual(return_code, 1)
172 self.assertLog(['ERROR: No issue number given and no issue for current b ranch. This tool requires a CL\n' 172 self.assertLog(['ERROR: No issue number given and no issue for current b ranch. This tool requires a CL\n'
173 'to operate on; please run `git cl upload` on this branc h first, or use the --issue\n' 173 'to operate on; please run `git cl upload` on this branc h first, or use the --issue\n'
174 'option to download baselines for another existing CL.\n ']) 174 'option to download baselines for another existing CL.\n '])
175 175
176 def test_execute_with_issue_number_from_branch(self): 176 def test_execute_with_issue_number_from_branch(self):
177 git_cl = GitCL(self.tool) 177 git_cl = GitCL(self.tool)
178 git_cl.get_issue_number = lambda: '11112222' 178 git_cl.get_issue_number = lambda: '11112222'
179 git_cl.latest_try_jobs = lambda _: [Build('MOCK Try Win', 5000)]
179 self.command.git_cl = lambda: git_cl 180 self.command.git_cl = lambda: git_cl
180 return_code = self.command.execute(self.command_options(), [], self.tool ) 181 return_code = self.command.execute(self.command_options(), [], self.tool )
181 self.assertEqual(return_code, 0) 182 self.assertEqual(return_code, 0)
182 self.assertLog([ 183 self.assertLog([
183 'INFO: Rebaselining fast/dom/prototype-inheritance.html\n', 184 'INFO: Rebaselining fast/dom/prototype-inheritance.html\n',
184 'INFO: Rebaselining fast/dom/prototype-newtest.html\n', 185 'INFO: Rebaselining fast/dom/prototype-newtest.html\n',
185 'INFO: Rebaselining fast/dom/prototype-slowtest.html\n', 186 'INFO: Rebaselining fast/dom/prototype-slowtest.html\n',
186 'INFO: Rebaselining fast/dom/prototype-taco.html\n', 187 'INFO: Rebaselining fast/dom/prototype-taco.html\n',
187 'INFO: Rebaselining svg/dynamic-updates/SVGFEDropShadowElement-dom-s tdDeviation-attr.html\n', 188 'INFO: Rebaselining svg/dynamic-updates/SVGFEDropShadowElement-dom-s tdDeviation-attr.html\n',
188 ]) 189 ])
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 320
320 def test_bails_when_there_are_unstaged_baselines(self): 321 def test_bails_when_there_are_unstaged_baselines(self):
321 git = self.tool.git() 322 git = self.tool.git()
322 git.unstaged_changes = lambda: {'third_party/WebKit/LayoutTests/my-test- expected.txt': '?'} 323 git.unstaged_changes = lambda: {'third_party/WebKit/LayoutTests/my-test- expected.txt': '?'}
323 return_code = self.command.execute(self.command_options(issue=11112222), [], self.tool) 324 return_code = self.command.execute(self.command_options(issue=11112222), [], self.tool)
324 self.assertEqual(return_code, 1) 325 self.assertEqual(return_code, 1)
325 self.assertLog([ 326 self.assertLog([
326 'ERROR: Aborting: there are unstaged baselines:\n', 327 'ERROR: Aborting: there are unstaged baselines:\n',
327 'ERROR: /mock-checkout/third_party/WebKit/LayoutTests/my-test-expe cted.txt\n', 328 'ERROR: /mock-checkout/third_party/WebKit/LayoutTests/my-test-expe cted.txt\n',
328 ]) 329 ])
OLDNEW
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698