Changeset 83614 in webkit
- Timestamp:
- Apr 12, 2011 11:30:17 AM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r83603 r83614 1 2011-04-12 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 commit-queue should upload failure diffs when tests fail 6 https://bugs.webkit.org/show_bug.cgi?id=58348 7 8 This change was mostly just plumbing. We were already saving 9 this information for flaky test reporting. I just made it possible 10 for normal failures to report archives as well. 11 12 I did a little abstraction work to try and share some code between 13 flakytestreporter.py and this new code. There is still more we could do. 14 15 In making this change I also went through and updated the various 16 places we have urls hard-coded in our python and pointed them at 17 common.config.urls. 18 19 * Scripts/webkitpy/common/checkout/scm.py: 20 * Scripts/webkitpy/common/net/bugzilla/bugzilla.py: 21 * Scripts/webkitpy/common/net/buildbot/buildbot.py: 22 * Scripts/webkitpy/common/net/statusserver.py: 23 * Scripts/webkitpy/layout_tests/port/base.py: 24 * Scripts/webkitpy/tool/bot/botinfo.py: Added. 25 * Scripts/webkitpy/tool/bot/botinfo_unittest.py: Added. 26 * Scripts/webkitpy/tool/bot/commitqueuetask.py: 27 * Scripts/webkitpy/tool/bot/flakytestreporter.py: 28 * Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py: 29 * Scripts/webkitpy/tool/commands/queues.py: 30 1 31 2011-04-12 Daniel Bates <dbates@rim.com> 2 32 -
trunk/Tools/Scripts/webkitpy/common/checkout/scm.py
r83152 r83614 321 321 322 322 class SVN(SCM): 323 # FIXME: We should move these values to a WebKit-specific config file.323 # FIXME: These belong in common.config.urls 324 324 svn_server_host = "svn.webkit.org" 325 325 svn_server_realm = "<http://svn.webkit.org:80> Mac OS Forge" -
trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
r82766 r83614 221 221 self.browser.set_handle_robots(False) 222 222 223 # FIXME: Much of this should go into some sort of config module: 223 # FIXME: Much of this should go into some sort of config module, 224 # such as common.config.urls. 224 225 bug_server_host = "bugs.webkit.org" 225 226 bug_server_regex = "https?://%s/" % re.sub('\.', '\\.', bug_server_host) -
trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot.py
r82313 r83614 268 268 269 269 class BuildBot(object): 270 # FIXME: This should move into some sort of webkit_config.py270 # FIXME: This should move into common.config.urls. 271 271 default_host = "build.webkit.org" 272 272 -
trunk/Tools/Scripts/webkitpy/common/net/statusserver.py
r75225 r83614 26 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 # 29 # This the client designed to talk to Tools/QueueStatusServer. 28 30 29 31 from webkitpy.common.net.networktransaction import NetworkTransaction … … 40 42 41 43 class StatusServer: 44 # FIXME: This should probably move to common.config.urls. 42 45 default_host = "queues.webkit.org" 43 46 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py
r83475 r83614 130 130 self._wdiff_available = True 131 131 132 # FIXME: prettypatch.py knows this path, why is it copied here? 132 133 self._pretty_patch_path = self.path_from_webkit_base("Websites", 133 134 "bugs.webkit.org", "PrettyPatch", "prettify.rb") -
trunk/Tools/Scripts/webkitpy/tool/bot/commitqueuetask.py
r82484 r83614 60 60 self._patch = patch 61 61 self._script_error = None 62 self._results_archive_from_patch_test_run = None 62 63 63 64 def _validate(self): … … 202 203 203 204 if self._build_and_test_without_patch(): 204 return self.report_failure( ) # The error from the previous ._test() run is real, report it.205 return self.report_failure(first_results_archive) # The error from the previous ._test() run is real, report it. 205 206 return False # Tree must be red, just retry later. 206 207 207 def report_failure(self): 208 def results_archive_from_patch_test_run(self, patch): 209 assert(self._patch.id() == patch.id()) # CommitQueueTask is not currently re-useable. 210 return self._results_archive_from_patch_test_run 211 212 def report_failure(self, results_archive=None): 208 213 if not self._validate(): 209 214 return False 215 self._results_archive_from_patch_test_run = results_archive 210 216 raise self._script_error 211 217 -
trunk/Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py
r78779 r83614 34 34 from webkitpy.common.net.layouttestresults import path_for_layout_test, LayoutTestResults 35 35 from webkitpy.common.config import urls 36 from webkitpy.tool.bot.botinfo import BotInfo 36 37 from webkitpy.tool.grammar import plural, pluralize, join_with_separators 37 38 … … 43 44 self._tool = tool 44 45 self._bot_name = bot_name 46 self._bot_info = BotInfo(tool) 45 47 46 48 def _author_emails_for_test(self, flaky_test): … … 122 124 return " (%s: %s)" % (heading_string, authors_string) 123 125 124 def _bot_information(self):125 bot_id = self._tool.status_server.bot_id126 bot_id_string = "Bot: %s " % (bot_id) if bot_id else ""127 return "%sPort: %s Platform: %s" % (bot_id_string, self._tool.port().name(), self._tool.platform.display_name())128 129 126 def _latest_flake_message(self, flaky_result, patch): 130 127 failure_messages = [failure.message() for failure in flaky_result.failures] 131 128 flake_message = "The %s just saw %s flake (%s) while processing attachment %s on bug %s." % (self._bot_name, flaky_result.filename, ", ".join(failure_messages), patch.id(), patch.bug_id()) 132 return "%s\n%s" % (flake_message, self._bot_info rmation())129 return "%s\n%s" % (flake_message, self._bot_info.summary_text()) 133 130 134 131 def _results_diff_path_for_test(self, test_path): -
trunk/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py
r75583 r83614 98 98 self.assertEqual(reporter._follow_duplicate_chain(bug).id(), 76) 99 99 100 def test_bot_information(self):101 tool = MockTool()102 tool.status_server = MockStatusServer("MockBotId")103 reporter = FlakyTestReporter(tool, 'dummy-queue')104 self.assertEqual(reporter._bot_information(), "Bot: MockBotId Port: MockPort Platform: MockPlatform 1.0")105 106 100 def test_report_flaky_tests_creating_bug(self): 107 101 tool = MockTool() -
trunk/Tools/Scripts/webkitpy/tool/commands/queues.py
r76071 r83614 45 45 from webkitpy.common.system.deprecated_logging import error, log 46 46 from webkitpy.common.system.executive import ScriptError 47 from webkitpy.tool.bot.botinfo import BotInfo 47 48 from webkitpy.tool.bot.commitqueuetask import CommitQueueTask, CommitQueueTaskDelegate 48 49 from webkitpy.tool.bot.feeders import CommitQueueFeeder, EWSFeeder … … 259 260 return True 260 261 262 # FIXME: This is not really specific to the commit-queue and could be shared. 263 def _upload_results_archive_for_patch(self, patch, results_archive_zip): 264 bot_id = self._tool.status_server.bot_id or "bot" 265 description = "Archive of layout-test-results from %s" % bot_id 266 # results_archive is a ZipFile object, grab the File object (.fp) to pass to Mechanize for uploading. 267 results_archive_file = results_archive_zip.fp 268 # Rewind the file object to start (since Mechanize won't do that automatically) 269 # See https://bugs.webkit.org/show_bug.cgi?id=54593 270 results_archive_file.seek(0) 271 comment_text = "The attached test failures were seen while running run-webkit-tests on the %s.\n" % (self.name) 272 # FIXME: We could easily list the test failures from the archive here. 273 comment_text += BotInfo(self._tool).summary_text() 274 self._tool.bugs.add_attachment_to_bug(patch.bug_id(), results_archive_file, description, filename="layout-test-results.zip", comment_text=comment_text) 275 261 276 def process_work_item(self, patch): 262 277 self._cc_watchers(patch.bug_id()) … … 270 285 validator = CommitterValidator(self._tool.bugs) 271 286 validator.reject_patch_from_commit_queue(patch.id(), self._error_message_for_bug(task.failure_status_id, e)) 287 results_archive = task.results_archive_from_patch_test_run(patch) 288 if results_archive: 289 self._upload_results_archive_for_patch(patch, results_archive) 272 290 self._did_fail(patch) 273 291 -
trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py
r82484 r83614 389 389 queue.bind_to_tool(MockTool()) 390 390 patch = queue._tool.bugs.fetch_attachment(128) 391 # This is just to test that the method doesn't raise. 391 392 queue.archive_last_layout_test_results(patch) 393 394 def test_upload_results_archive_for_patch(self): 395 queue = CommitQueue() 396 queue.bind_to_tool(MockTool()) 397 patch = queue._tool.bugs.fetch_attachment(128) 398 expected_stderr = """MOCK add_attachment_to_bug: bug_id=42, description=Archive of layout-test-results from bot filename=layout-test-results.zip 399 -- Begin comment -- 400 The attached test failures were seen while running run-webkit-tests on the commit-queue. 401 Port: MockPort Platform: MockPlatform 1.0 402 -- End comment -- 403 """ 404 OutputCapture().assert_outputs(self, queue._upload_results_archive_for_patch, [patch, Mock()], expected_stderr=expected_stderr) 392 405 393 406
Note: See TracChangeset
for help on using the changeset viewer.