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

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

Issue 2658983003: Add build link to rebaseline-o-matic CL descriptions. (Closed)
Patch Set: 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
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 optparse 5 import optparse
6 6
7 from webkitpy.common.net.buildbot import Build 7 from webkitpy.common.net.buildbot import Build
8 from webkitpy.common.net.layout_test_results import LayoutTestResults 8 from webkitpy.common.net.layout_test_results import LayoutTestResults
9 from webkitpy.common.system.executive_mock import MockExecutive 9 from webkitpy.common.system.executive_mock import MockExecutive
10 from webkitpy.layout_tests.builder_list import BuilderList 10 from webkitpy.layout_tests.builder_list import BuilderList
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 'foobarbaz1@chromium.org', 100 'foobarbaz1@chromium.org',
101 set(['24182']), 101 set(['24182']),
102 True)) 102 True))
103 103
104 def test_commit_message(self): 104 def test_commit_message(self):
105 author = "foo@chromium.org" 105 author = "foo@chromium.org"
106 revision = 1234 106 revision = 1234
107 commit = "abcd567" 107 commit = "abcd567"
108 bugs = set() 108 bugs = set()
109 self.assertEqual(self.command.commit_message(author, revision, commit, b ugs), 109 self.assertEqual(self.command.commit_message(author, revision, commit, b ugs),
110 """Auto-rebaseline for r1234 110 'Auto-rebaseline for r1234\n\n'
111 111 'https://chromium.googlesource.com/chromium/src/+/abcd5 67\n\n'
112 https://chromium.googlesource.com/chromium/src/+/abcd567 112 'TBR=foo@chromium.org\n')
113
114 TBR=foo@chromium.org
115 """)
116 113
117 bugs = set(["234", "345"]) 114 bugs = set(["234", "345"])
118 self.assertEqual(self.command.commit_message(author, revision, commit, b ugs), 115 self.assertEqual(self.command.commit_message(author, revision, commit, b ugs),
119 """Auto-rebaseline for r1234 116 'Auto-rebaseline for r1234\n\n'
117 'https://chromium.googlesource.com/chromium/src/+/abcd5 67\n\n'
118 'BUG=234,345\n'
119 'TBR=foo@chromium.org\n')
120 120
121 https://chromium.googlesource.com/chromium/src/+/abcd567 121 self.tool.environ['BUILDBOT_MASTERNAME'] = 'my.master'
122 122 self.tool.environ['BUILDBOT_BUILDERNAME'] = 'b'
123 BUG=234,345 123 self.tool.environ['BUILDBOT_BUILDNUMBER'] = '123'
124 TBR=foo@chromium.org 124 self.assertEqual(self.command.commit_message(author, revision, commit, b ugs),
125 """) 125 'Auto-rebaseline for r1234\n\n'
126 'Build: https://build.chromium.org/p/my.master/builders /b/builds/123\n\n'
127 'https://chromium.googlesource.com/chromium/src/+/abcd5 67\n\n'
128 'BUG=234,345\n'
129 'TBR=foo@chromium.org\n')
126 130
127 def test_no_needs_rebaseline_lines(self): 131 def test_no_needs_rebaseline_lines(self):
128 def blame(_): 132 def blame(_):
129 return """ 133 return """
130 6469e754a1 path/to/TestExpectations (<foobarbaz1@chromium.org> 2013-06-14 20:18:46 +0000 11) crbug.com/24182 [ Debug ] path/to/norebaseline. html [ Failure ] 134 6469e754a1 path/to/TestExpectations (<foobarbaz1@chromium.org> 2013-06-14 20:18:46 +0000 11) crbug.com/24182 [ Debug ] path/to/norebaseline. html [ Failure ]
131 """ 135 """
132 self.tool.scm().blame = blame 136 self.tool.scm().blame = blame
133 137
134 self._execute_with_mock_options() 138 self._execute_with_mock_options()
135 self.assertEqual(self.tool.executive.calls, []) 139 self.assertEqual(self.tool.executive.calls, [])
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 529
526 def test_execute_with_dry_run(self): 530 def test_execute_with_dry_run(self):
527 self._basic_execute_test([], dry_run=True) 531 self._basic_execute_test([], dry_run=True)
528 self.assertEqual(self.tool.scm().local_commits(), []) 532 self.assertEqual(self.tool.scm().local_commits(), [])
529 533
530 def test_bot_revision_data(self): 534 def test_bot_revision_data(self):
531 self._setup_mock_build_data() 535 self._setup_mock_build_data()
532 self.assertEqual( 536 self.assertEqual(
533 self.command.bot_revision_data(self.tool.scm()), 537 self.command.bot_revision_data(self.tool.scm()),
534 [{'builder': 'MOCK Win7', 'revision': '9000'}]) 538 [{'builder': 'MOCK Win7', 'revision': '9000'}])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698