Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py

Issue 2808043005: rebaseline-cl: Add logic for selecting a related builder when filling in results. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py
index eeef1f691152de803998a1d6edf5b41a905a7afd..8852aa6042cbd7441c4ca62756dd3c2f94b12f89 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py
@@ -250,13 +250,23 @@ class RebaselineCL(AbstractParallelRebaselineCommand):
test_baseline_set.add(test_prefix, build, port)
return test_baseline_set
- def _choose_fill_in_build(self, _, build_port_pairs):
+ def _choose_fill_in_build(self, target_port, build_port_pairs):
"""Returns a Build to use to supply results for the given port.
Ideally, this should return a build for a similar port so that the
results from the selected build may also be correct for the target port.
"""
- # TODO(qyearsley): Decide what build to use for a given port
- # in a more sophisticated way, such that a build with a
- # "similar" port will be used when available.
- return build_port_pairs[0][0]
+ def os_name(port):
+ if '-' not in port:
wkorman 2017/04/13 16:41:35 Suggest adding comment to document what format we'
qyearsley 2017/04/14 00:13:08 Right, good idea to be cautious. The actual forma
+ return port
+ return port[:port.rfind('-')]
+
+ # If any Build exists with the same OS, use the first one.
wkorman 2017/04/13 16:41:35 What is the order of the builds at this point -- u
qyearsley 2017/04/14 00:13:08 At this point, they should be in the order returne
+ target_os = os_name(target_port)
+ same_os_builds = sorted(b for b, p in build_port_pairs if os_name(p) == target_os)
+ if same_os_builds:
+ return same_os_builds[0]
+
+ # Otherwise, perhaps any build will do, for example if the results are
+ # the same on all platforms. In this case, just return the first build.
+ return sorted(build_port_pairs)[0][0]
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698