Commit b49bf8a0 authored by eric@webkit.org's avatar eric@webkit.org
Browse files

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

        Unreviewed.

        The commit-queue should file bugs about flaky tests it encounters
        https://bugs.webkit.org/show_bug.cgi?id=50803

        create_bug_for_flaky_test was insufficiently tested, thus buggy.
        Now it's tested.

        * Scripts/webkitpy/tool/bot/flakytestreporter.py:
        * Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73694 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3cfd8b85
2010-12-10 Eric Seidel <eric@webkit.org>
Unreviewed.
The commit-queue should file bugs about flaky tests it encounters
https://bugs.webkit.org/show_bug.cgi?id=50803
create_bug_for_flaky_test was insufficiently tested, thus buggy.
Now it's tested.
* Scripts/webkitpy/tool/bot/flakytestreporter.py:
* Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py:
2010-12-10 Eric Seidel <eric@webkit.org>
 
Unreviewed. Somehow this last-minute edit didn't quite get committed.
......
......@@ -65,7 +65,7 @@ class FlakyTestReporter(object):
def _create_bug_for_flaky_test(self, flaky_test, author_emails, latest_flake_message):
format_values = {
'test': flaky_test,
'authors': join_with_separators(author_emails),
'authors': join_with_separators(sorted(author_emails)),
'flake_message': latest_flake_message,
'test_url': urls.view_source_url(flaky_test),
'bot_name': self._bot_name,
......@@ -73,6 +73,7 @@ class FlakyTestReporter(object):
title = "Flaky Test: %(test)s" % format_values
description = """This is an automatically generated bug from the %(bot_name)s.
%(test)s has been flaky on the %(bot_name)s.
%(test)s was authored by %(authors)s.
%(test_url)s
......@@ -83,9 +84,9 @@ The bots will update this with information from each new failure.
If you would like to track this test fix with another bug, please close this bug as a duplicate.
""" % format_values
self._tool_bugs.create_bug(title, description,
self._tool.bugs.create_bug(title, description,
component="Tools / Tests",
cc=",".join(author_bugzilla_emails))
cc=",".join(author_emails))
# This is over-engineered, but it makes for pretty bug messages.
def _optional_author_string(self, author_emails):
......
......@@ -29,6 +29,7 @@
import unittest
from webkitpy.common.config.committers import Committer
from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.tool.bot.flakytestreporter import FlakyTestReporter
from webkitpy.tool.mocktool import MockTool
......@@ -59,4 +60,23 @@ class FlakyTestReporterTest(unittest.TestCase):
self._assert_emails_for_test(["test1@test.com", "test1@test.com"])
self._assert_emails_for_test(["test1@test.com", "test2@test.com"])
def test_create_bug_for_flaky_test(self):
reporter = FlakyTestReporter(MockTool(), 'dummy-queue')
expected_stderr = """MOCK create_bug
bug_title: Flaky Test: foo/bar.html
bug_description: This is an automatically generated bug from the dummy-queue.
foo/bar.html has been flaky on the dummy-queue.
foo/bar.html was authored by test@test.com.
http://trac.webkit.org/browser/trunk/foo/bar.html
FLAKE_MESSAGE
The bots will update this with information from each new failure.
If you would like to track this test fix with another bug, please close this bug as a duplicate.
"""
OutputCapture().assert_outputs(self, reporter._create_bug_for_flaky_test, ['foo/bar.html', ['test@test.com'], 'FLAKE_MESSAGE'], expected_stderr=expected_stderr)
# report_flaky_tests is tested by queues_unittest
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment