Changeset 74373 in webkit


Ignore:
Timestamp:
Dec 20, 2010 3:55:36 PM (13 years ago)
Author:
eric@webkit.org
Message:

2010-12-20 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

commit-queue should include bot id when attaching failure diffs
https://bugs.webkit.org/show_bug.cgi?id=51280

This is a tiny change to include the bot id in the name of the attachment.
Most of this diff is just changing the unit test expectations
now that I hid the comment printing when the comment is None.

  • Scripts/webkitpy/tool/bot/flakytestreporter.py:
  • Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py:
  • Scripts/webkitpy/tool/commands/upload_unittest.py:
  • Scripts/webkitpy/tool/mocktool.py:
Location:
trunk/Tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r74365 r74373  
     12010-12-20  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        commit-queue should include bot id when attaching failure diffs
     6        https://bugs.webkit.org/show_bug.cgi?id=51280
     7
     8        This is a tiny change to include the bot id in the name of the attachment.
     9        Most of this diff is just changing the unit test expectations
     10        now that I hid the comment printing when the comment is None.
     11
     12        * Scripts/webkitpy/tool/bot/flakytestreporter.py:
     13        * Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py:
     14        * Scripts/webkitpy/tool/commands/upload_unittest.py:
     15        * Scripts/webkitpy/tool/mocktool.py:
     16
    1172010-12-20  Jeff Miller  <jeffm@apple.com>
    218
  • trunk/Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py

    r74138 r74373  
    172172            if self._tool.filesystem.exists(results_diff_path):
    173173                results_diff = self._tool.filesystem.read_binary_file(results_diff_path)
    174                 self._tool.bugs.add_attachment_to_bug(flake_bug_id, results_diff, "Failure diff from bot", filename="failure.diff")
     174                bot_id = self._tool.status_server.bot_id or "bot"
     175                self._tool.bugs.add_attachment_to_bug(flake_bug_id, results_diff, "Failure diff from %s" % bot_id, filename="failure.diff")
    175176            else:
    176177                _log.error("%s does not exist as expected, not uploading." % results_diff_path)
  • trunk/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py

    r74138 r74373  
    9898    def test_report_flaky_tests_creating_bug(self):
    9999        tool = MockTool()
    100         tool.filesystem = MockFileSystem({"/mock/foo/bar.diff": "mock"})
     100        tool.filesystem = MockFileSystem({"/mock/foo/bar-diffs.txt": "mock"})
     101        tool.status_server = MockStatusServer(bot_id="mock-bot-id")
    101102        reporter = FlakyTestReporter(tool, 'dummy-queue')
    102103        reporter._lookup_bug_for_flaky_test = lambda bug_id: None
     
    111112
    112113The dummy-queue just saw foo/bar.html flake while processing attachment 197 on bug 42.
    113 Port: MockPort  Platform: MockPlatform 1.0
     114Bot: mock-bot-id  Port: MockPort  Platform: MockPlatform 1.0
    114115
    115116The bots will update this with information from each new failure.
     
    120121cc: abarth@webkit.org
    121122blocked: 50856
     123MOCK add_attachment_to_bug: bug_id=78, description=Failure diff from mock-bot-id filename=failure.diff
    122124MOCK bug comment: bug_id=42, cc=None
    123125--- Begin comment ---
  • trunk/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py

    r73827 r74373  
    6464Obsoleting 2 old patches on bug 42
    6565MOCK add_patch_to_bug: bug_id=42, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False
    66 -- Begin comment --
    67 None
    68 -- End comment --
    6966MOCK: user.open_url: http://example.com/42
    7067"""
     
    7370
    7471    def test_land_safely(self):
    75         expected_stderr = "Obsoleting 2 old patches on bug 42\nMOCK add_patch_to_bug: bug_id=42, description=Patch for landing, mark_for_review=False, mark_for_commit_queue=False, mark_for_landing=True\n-- Begin comment --\nNone\n-- End comment --\n"
     72        expected_stderr = "Obsoleting 2 old patches on bug 42\nMOCK add_patch_to_bug: bug_id=42, description=Patch for landing, mark_for_review=False, mark_for_commit_queue=False, mark_for_landing=True\n"
    7673        self.assert_execute_outputs(LandSafely(), [42], expected_stderr=expected_stderr)
    7774
     
    9693Obsoleting 2 old patches on bug 42
    9794MOCK add_patch_to_bug: bug_id=42, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False
    98 -- Begin comment --
    99 None
    100 -- End comment --
    10195MOCK: user.open_url: http://example.com/42
    10296"""
     
    110104        options.bug_id = 42
    111105        options.comment = "MOCK comment"
    112         expected_stderr = "Bug: <http://example.com/42> Bug with two r+'d and cq+'d patches, one of which has an invalid commit-queue setter.\nRevision: 9876\nMOCK: user.open_url: http://example.com/42\nAdding comment to Bug 42.\nMOCK bug comment: bug_id=42, cc=None\n--- Begin comment ---\nMOCK comment\n\nCommitted r9876: <http://trac.webkit.org/changeset/9876>\n--- End comment ---\n\n"
     106        expected_stderr = """Bug: <http://example.com/42> Bug with two r+'d and cq+'d patches, one of which has an invalid commit-queue setter.
     107Revision: 9876
     108MOCK: user.open_url: http://example.com/42
     109Adding comment to Bug 42.
     110MOCK bug comment: bug_id=42, cc=None
     111--- Begin comment ---
     112MOCK comment
     113
     114Committed r9876: <http://trac.webkit.org/changeset/9876>
     115--- End comment ---
     116
     117"""
    113118        expected_stdout = "Is this correct?\n"
    114119        self.assert_execute_outputs(MarkBugFixed(), [], expected_stdout=expected_stdout, expected_stderr=expected_stderr, tool=tool, options=options)
  • trunk/Tools/Scripts/webkitpy/tool/mocktool.py

    r74138 r74373  
    343343            bug_id, cc, comment_text))
    344344
     345    def add_attachment_to_bug(self,
     346                              bug_id,
     347                              file_or_string,
     348                              description,
     349                              filename=None,
     350                              comment_text=None):
     351        log("MOCK add_attachment_to_bug: bug_id=%s, description=%s filename=%s" % (bug_id, description, filename))
     352        if comment_text:
     353            log("-- Begin comment --")
     354            log(comment_text)
     355            log("-- End comment --")
     356
    345357    def add_patch_to_bug(self,
    346358                         bug_id,
     
    353365        log("MOCK add_patch_to_bug: bug_id=%s, description=%s, mark_for_review=%s, mark_for_commit_queue=%s, mark_for_landing=%s" %
    354366            (bug_id, description, mark_for_review, mark_for_commit_queue, mark_for_landing))
    355         log("-- Begin comment --")
    356         log(comment_text)
    357         log("-- End comment --")
     367        if comment_text:
     368            log("-- Begin comment --")
     369            log(comment_text)
     370            log("-- End comment --")
    358371
    359372
Note: See TracChangeset for help on using the changeset viewer.