Commit 247f7b55 authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa Committed by Commit Bot

wpt expectations updater: Discard empty |versions| in simplify_specifiers()

Since commit 4874fdef ("[blinkpy] Stop rebaselining on Android bots"),
android_blink_rel is no longer part of the rebaselining bots used by
wpt-importer.

However, 'android' is still part of Port.CONFIGURATION_SPECIFIER_MACROS,
which is passed as |specifier_macros| to simplify_specifiers(). And since
Android is no longer covered by trybots, |versions| in that function ends up
an empty set, which by definition means all its elements are in
|specifiers|.

In practice, this means that a test such as
external/wpt/preload/onload-event.html, which was failing on some Mac bots,
would cause simplify_specifiers() to return something like ['Android',
'Mac10.10'] and we would try to add repeated lines to TestExpectations that
look like

     crbug.com/626703 [ Android ] foo [ Failure Timeout ]
     crbug.com/626703 [ Mac10.13 ] foo [ Failure Timeout ]
     crbug.com/626703 [ Android ] foo [ Failure Timeout ]
     crbug.com/626703 [ Mac10.12 ] foo [ Failure Timeout ]

which fails our presubmit checks as expected.

Fix it by not taking empty sets into consideration when looping. This
unblocks WPT imports again.

Bug: 567947
Change-Id: Ia471cad213192fa23425d5e8eecf47457605f9ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1631663
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Robert Ma <robertma@chromium.org>
Reviewed-by: default avatarRobert Ma <robertma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663740}
parent 1a8addd7
......@@ -433,6 +433,8 @@ class WPTExpectationsUpdater(object):
# Only consider version specifiers that have corresponding try bots.
versions = {s.lower() for s in versions if s.lower() in covered_by_try_bots}
if len(versions) == 0:
continue
if versions <= specifiers:
specifiers -= versions
specifiers.add(macro)
......
......@@ -412,6 +412,16 @@ class WPTExpectationsUpdaterTest(LoggingTestCase):
self.assertEqual(updater.simplify_specifiers(['mac10.10', 'mac10.11'], macros), ['Mac'])
self.assertEqual(updater.simplify_specifiers(['Mac10.10', 'Mac10.11', 'Trusty', 'Win7', 'Win10'], macros), [])
def test_simplify_specifiers_port_not_tested_by_trybots(self):
host = self.mock_host()
updater = WPTExpectationsUpdater(host)
macros = {
'mac': ['Mac10.10', 'mac10.11'],
'win': ['win10'],
'foo': ['bar'],
}
self.assertEqual(updater.simplify_specifiers(['mac10.10', 'mac10.11'], macros), ['Mac'])
def test_normalized_specifiers_with_skipped_test(self):
host = self.mock_host()
expectations_path = '/test.checkout/wtests/NeverFixTests'
......
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