Changeset 116572 in webkit


Ignore:
Timestamp:
May 9, 2012 4:22:04 PM (12 years ago)
Author:
tomz@codeaurora.org
Message:

Fix overzealous re-opened since blocked by... message
https://bugs.webkit.org/show_bug.cgi?id=86020

Reviewed by Adam Barth.

Changed CreateBug behavior to only re-open a blocked bug if it
was RESOLVED. Also had to update the test infrastructure slightly
to allow for distinct mock commit revisions, so one could point
to a RESOLVED bug for testing while another pointed to an OPEN bug.

Also moved default created mock bug to be 60001 instead of 50004
which already exists as a reference mock bug.

  • Scripts/webkitpy/common/checkout/checkout_mock.py:

(MockCheckout.init):
(MockCheckout.commit_info_for_revision):

  • Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py:

(MockBugzilla.create_bug):

  • Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py:
  • Scripts/webkitpy/tool/commands/download_unittest.py:

(test_create_rollout_resolved):

  • Scripts/webkitpy/tool/commands/queries_unittest.py:

(FailureReasonTest.test_blame_line_for_revision):

  • Scripts/webkitpy/tool/steps/createbug.py:

(CreateBug.run):

Location:
trunk/Tools
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r116571 r116572  
     12012-05-09  Tom Zakrajsek  <tomz@codeaurora.org>
     2
     3        Fix overzealous re-opened since blocked by... message
     4        https://bugs.webkit.org/show_bug.cgi?id=86020
     5
     6        Reviewed by Adam Barth.
     7
     8        Changed CreateBug behavior to only re-open a blocked bug if it
     9        was RESOLVED.  Also had to update the test infrastructure slightly
     10        to allow for distinct mock commit revisions, so one could point
     11        to a RESOLVED bug for testing while another pointed to an OPEN bug.
     12
     13        Also moved default created mock bug to be 60001 instead of 50004
     14        which already exists as a reference mock bug.
     15
     16        * Scripts/webkitpy/common/checkout/checkout_mock.py:
     17        (MockCheckout.__init__):
     18        (MockCheckout.commit_info_for_revision):
     19        * Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py:
     20        (MockBugzilla.create_bug):
     21        * Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py:
     22        * Scripts/webkitpy/tool/commands/download_unittest.py:
     23        (test_create_rollout_resolved):
     24        * Scripts/webkitpy/tool/commands/queries_unittest.py:
     25        (FailureReasonTest.test_blame_line_for_revision):
     26        * Scripts/webkitpy/tool/steps/createbug.py:
     27        (CreateBug.run):
     28
    1292012-05-09  Hugo Parente Lima  <hugo.lima@openbossa.org>
    230
  • trunk/Tools/Scripts/webkitpy/common/checkout/checkout_mock.py

    r107302 r116572  
    4141
    4242
     43committer_list = CommitterList()
     44
     45mock_revisions = {
     46    1: CommitInfo(852, "eric@webkit.org", {
     47        "bug_id": 50000,
     48        "author_name": "Adam Barth",
     49        "author_email": "abarth@webkit.org",
     50        "author": committer_list.contributor_by_email("abarth@webkit.org"),
     51        "reviewer_text": "Darin Adler",
     52        "reviewer": committer_list.committer_by_name("Darin Adler"),
     53        "changed_files": [
     54            "path/to/file",
     55            "another/file",
     56        ],
     57    }),
     58    3001: CommitInfo(3001, "tomz@codeaurora.org", {
     59        "bug_id": 50004,
     60        "author_name": "Tom Zakrajsek",
     61        "author_email": "tomz@codeaurora.org",
     62        "author": committer_list.contributor_by_email("tomz@codeaurora.org"),
     63        "reviewer_text": "Darin Adler",
     64        "reviewer": committer_list.committer_by_name("Darin Adler"),
     65        "changed_files": [
     66            "path/to/file",
     67            "another/file",
     68        ],
     69    })
     70}
     71
    4372class MockCheckout(object):
    4473    def __init__(self):
     
    4776        self._filesystem = MockFileSystem()
    4877
    49     # FIXME: This should move onto the Host object, and we should use a MockCommitterList for tests.
    50     _committer_list = CommitterList()
     78    def commit_info_for_revision(self, svn_revision):
     79        # There are legacy tests that all expected these revision numbers to map
     80        # to the same commit description (now mock_revisions[1])
     81        if svn_revision in [32, 123, 852, 853, 854, 1234, 21654, 21655, 21656]:
     82            return mock_revisions[1]
    5183
    52     def commit_info_for_revision(self, svn_revision):
    53         # The real Checkout would probably throw an exception, but this is the only way tests have to get None back at the moment.
    54         if not svn_revision:
    55             return None
    56         return CommitInfo(svn_revision, "eric@webkit.org", {
    57             "bug_id": 50000,
    58             "author_name": "Adam Barth",
    59             "author_email": "abarth@webkit.org",
    60             "author": self._committer_list.contributor_by_email("abarth@webkit.org"),
    61             "reviewer_text": "Darin Adler",
    62             "reviewer": self._committer_list.committer_by_name("Darin Adler"),
    63             "changed_files": [
    64                 "path/to/file",
    65                 "another/file",
    66             ],
    67         })
     84        if svn_revision in mock_revisions:
     85            return mock_revisions[svn_revision]
     86
     87        # any "unrecognized" svn_revision will return None.
    6888
    6989    def is_path_to_changelog(self, path):
  • trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py

    r116414 r116572  
    324324        if blocked:
    325325            log("blocked: %s" % blocked)
    326         return 50004
     326        return 60001
    327327
    328328    def quips(self):
  • trunk/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py

    r99140 r116572  
    126126cc: abarth@webkit.org
    127127blocked: 50856
    128 MOCK add_attachment_to_bug: bug_id=50004, description=Failure diff from mock-bot-id filename=failure.diff
     128MOCK add_attachment_to_bug: bug_id=60001, description=Failure diff from mock-bot-id filename=failure.diff
    129129MOCK bug comment: bug_id=50000, cc=None
    130130--- Begin comment ---
    131131The dummy-queue encountered the following flaky tests while processing attachment 10000:
    132132
    133 foo/bar.html bug 50004 (author: abarth@webkit.org)
     133foo/bar.html bug 60001 (author: abarth@webkit.org)
    134134The dummy-queue is continuing to process your patch.
    135135--- End comment ---
  • trunk/Tools/Scripts/webkitpy/tool/commands/download_unittest.py

    r116245 r116572  
    262262cc: MOCK cc
    263263blocked: 50000
    264 MOCK reopen_bug 50000 with comment 'Re-opened since this is blocked by 50004'
    265 MOCK add_patch_to_bug: bug_id=50004, description=ROLLOUT of r852, mark_for_review=False, mark_for_commit_queue=True, mark_for_landing=False
     264MOCK add_patch_to_bug: bug_id=60001, description=ROLLOUT of r852, mark_for_review=False, mark_for_commit_queue=True, mark_for_landing=False
    266265-- Begin comment --
    267266Any committer can land this patch automatically by marking it commit-queue+.  The commit-queue will build and test the patch before landing to ensure that the rollout will be successful.  This process takes approximately 15 minutes.
     
    277276        self.assert_execute_outputs(CreateRollout(), ["855 852 854", "Reason"], options=self._default_options(), expected_stderr=expected_stderr)
    278277
     278    def test_create_rollout_resolved(self):
     279        expected_stderr = """Preparing rollout for bug 50004.
     280Updating working directory
     281MOCK create_bug
     282bug_title: REGRESSION(r3001): Reason
     283bug_description: http://trac.webkit.org/changeset/3001 broke the build:
     284Reason
     285component: MOCK component
     286cc: MOCK cc
     287blocked: 50004
     288MOCK reopen_bug 50004 with comment 'Re-opened since this is blocked by 60001'
     289MOCK add_patch_to_bug: bug_id=60001, description=ROLLOUT of r3001, mark_for_review=False, mark_for_commit_queue=True, mark_for_landing=False
     290-- Begin comment --
     291Any committer can land this patch automatically by marking it commit-queue+.  The commit-queue will build and test the patch before landing to ensure that the rollout will be successful.  This process takes approximately 15 minutes.
     292
     293If you would like to land the rollout faster, you can use the following command:
     294
     295  webkit-patch land-attachment ATTACHMENT_ID
     296
     297where ATTACHMENT_ID is the ID of this attachment.
     298-- End comment --
     299"""
     300        self.assert_execute_outputs(CreateRollout(), [3001, "Reason"], options=self._default_options(), expected_stderr=expected_stderr)
     301
    279302    def test_rollout(self):
    280303        expected_stderr = """Preparing rollout for bug 50000.
  • trunk/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py

    r113927 r116572  
    9999        command.bind_to_tool(tool)
    100100        # This is an artificial example, mostly to test the CommitInfo lookup failure case.
    101         self.assertEquals(command._blame_line_for_revision(None), "FAILED to fetch CommitInfo for rNone, likely missing ChangeLog")
     101        self.assertEquals(command._blame_line_for_revision(0), "FAILED to fetch CommitInfo for r0, likely missing ChangeLog")
    102102
    103103        def raising_mock(self):
    104104            raise Exception("MESSAGE")
    105105        tool.checkout().commit_info_for_revision = raising_mock
    106         self.assertEquals(command._blame_line_for_revision(None), "FAILED to fetch CommitInfo for rNone, exception: MESSAGE")
     106        self.assertEquals(command._blame_line_for_revision(0), "FAILED to fetch CommitInfo for r0, exception: MESSAGE")
    107107
    108108
  • trunk/Tools/Scripts/webkitpy/tool/steps/createbug.py

    r116245 r116572  
    11# Copyright (C) 2010 Google Inc. All rights reserved.
    2 # 
     2#
    33# Redistribution and use in source and binary forms, with or without
    44# modification, are permitted provided that the following conditions are
    55# met:
    6 # 
     6#
    77#     * Redistributions of source code must retain the above copyright
    88# notice, this list of conditions and the following disclaimer.
     
    1414# contributors may be used to endorse or promote products derived from
    1515# this software without specific prior written permission.
    16 # 
     16#
    1717# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    1818# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     
    5252        state["bug_id"] = self._tool.bugs.create_bug(state["bug_title"], state["bug_description"], blocked=blocks, component=self._options.component, cc=cc)
    5353        if blocks:
    54             self._tool.bugs.reopen_bug(blocks, "Re-opened since this is blocked by %s" % state["bug_id"])
     54            status = self._tool.bugs.fetch_bug(blocks).status()
     55            if status == 'RESOLVED':
     56                self._tool.bugs.reopen_bug(blocks, "Re-opened since this is blocked by %s" % state["bug_id"])
Note: See TracChangeset for help on using the changeset viewer.