Commit 64e23b8c authored by Quinten Yearsley's avatar Quinten Yearsley Committed by Commit Bot

[blinkpy update_expectations] Don't repeat bug numbers

When update_expectations.py is run, it outputs a suggested CL
description, including bug numbers.  This CL changes the output
to stop repeating bug numbers.

Change-Id: Iabe10680f07b28832e7336ceb2105a1db03eaa80
Reviewed-on: https://chromium-review.googlesource.com/1089293
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565751}
parent e950eaed
......@@ -48,8 +48,7 @@ def main(host, bot_test_expectations_factory, argv):
default='all',
help='type of expectations to update (default: %(default)s)')
parser.add_argument('--verbose', '-v', action='store_true', default=False, help='enable more verbose logging')
parser.add_argument('--show-results',
'-s',
parser.add_argument('--show-results', '-s',
action='store_true',
default=False,
help='Open results dashboard for all removed lines')
......@@ -388,9 +387,9 @@ class ExpectationsRemover(object):
def _bug_numbers(self):
"""Returns the list of all bug numbers affected by this change."""
numbers = []
numbers = set()
for line in self._expectations_to_remove():
for bug in line.bugs:
if bug.startswith(CHROMIUM_BUG_PREFIX):
numbers.append(bug[len(CHROMIUM_BUG_PREFIX):])
numbers.add(bug[len(CHROMIUM_BUG_PREFIX):])
return sorted(numbers)
......@@ -1411,13 +1411,13 @@ class UpdateTestExpectationsTest(LoggingTestCase):
"""
test_expectations_before = (
"""# Remove this since it's passing all runs.
crbug.com/2222 test/a.html [ Failure Pass ]
crbug.com/1111 test/a.html [ Failure Pass ]
# Remove this since, although there's a failure, it's not a timeout.
crbug.com/1111 test/b.html [ Pass Timeout ]
# Keep since we have both crashes and passes.
crbug.com/3333 test/c.html [ Crash Pass ]
crbug.com/2222 test/c.html [ Crash Pass ]
# Remove since it's passing all runs.
crbug.com/4444 test/d.html [ Failure ]""")
crbug.com/3333 test/d.html [ Failure ]""")
self._expectations_remover = self._create_expectations_remover()
self._define_builders({
......@@ -1440,14 +1440,14 @@ class UpdateTestExpectationsTest(LoggingTestCase):
}
self._expectations_remover.print_suggested_commit_description()
self.assertLog([
'INFO: Deleting line "crbug.com/2222 test/a.html [ Failure Pass ]"\n',
'INFO: Deleting line "crbug.com/1111 test/a.html [ Failure Pass ]"\n',
'INFO: Deleting line "crbug.com/1111 test/b.html [ Pass Timeout ]"\n',
'INFO: Deleting line "crbug.com/4444 test/d.html [ Failure ]"\n',
'INFO: Deleting line "crbug.com/3333 test/d.html [ Failure ]"\n',
'INFO: Suggested commit description:\n'
'Remove TestExpectations which are not failing in the specified way.\n\n'
'This change was made by the update_expectations.py script.\n\n'
'Recent test results history:\n'
'https://test-results.appspot.com/dashboards/flakiness_dashboard.html'
'#testType=webkit_layout_tests&tests=test/a.html,test/b.html,test/d.html\n\n'
'Bug: 1111, 2222, 4444\n'
'Bug: 1111, 3333\n'
])
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