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

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

Issue 2765863003: Refactoring: Replace test_prefix_list variables with TestBaselineSet objects. (Closed)
Patch Set: fix typo, return set from _builders_to_fetch_from Created 3 years, 9 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.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/auto_rebaseline.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/auto_rebaseline.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/auto_rebaseline.py
index f052a2744852b599885c3cad555ec49f70cc0b17..e0ede1135d535e7df0ecb280e1b4a76dc556a958 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/auto_rebaseline.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/auto_rebaseline.py
@@ -19,7 +19,7 @@ import urllib2
from webkitpy.common.net.buildbot import Build, current_build_link
from webkitpy.layout_tests.models.test_expectations import TestExpectations, BASELINE_SUFFIX_LIST
-from webkitpy.tool.commands.rebaseline import AbstractParallelRebaselineCommand
+from webkitpy.tool.commands.rebaseline import AbstractParallelRebaselineCommand, TestBaselineSet
_log = logging.getLogger(__name__)
@@ -150,10 +150,8 @@ class AutoRebaseline(AbstractParallelRebaselineCommand):
def link_to_patch(commit):
return 'https://chromium.googlesource.com/chromium/src/+/' + commit
- def get_test_prefix_list(self, tests):
- test_prefix_list = {}
- lines_to_remove = {}
-
+ def _make_test_baseline_set(self, tests):
+ test_baseline_set = TestBaselineSet(self._tool)
for builder_name in self._release_builders():
port_name = self._tool.builders.port_name_for_builder_name(builder_name)
port = self._tool.port_factory.get(port_name)
@@ -161,14 +159,8 @@ class AutoRebaseline(AbstractParallelRebaselineCommand):
for test in expectations.get_needs_rebaseline_failures():
if test not in tests:
continue
-
- if test not in test_prefix_list:
- lines_to_remove[test] = []
- test_prefix_list[test] = {}
- lines_to_remove[test].append(builder_name)
- test_prefix_list[test][Build(builder_name)] = BASELINE_SUFFIX_LIST
-
- return test_prefix_list, lines_to_remove
+ test_baseline_set.add(test, Build(builder_name))
+ return test_baseline_set
def _run_git_cl_command(self, options, command):
subprocess_command = ['git', 'cl'] + command
@@ -241,7 +233,7 @@ class AutoRebaseline(AbstractParallelRebaselineCommand):
_log.info('Rebaselining %s for r%s by %s.', list(tests), revision, author)
- test_prefix_list, _ = self.get_test_prefix_list(tests)
+ test_baseline_set = self._make_test_baseline_set(tests)
did_switch_branches = False
did_finish = False
@@ -257,8 +249,8 @@ class AutoRebaseline(AbstractParallelRebaselineCommand):
tool.git().create_clean_branch(rebaseline_branch_name)
did_switch_branches = True
- if test_prefix_list:
- self.rebaseline(options, test_prefix_list)
+ if test_baseline_set:
+ self.rebaseline(options, test_baseline_set)
if options.dry_run:
return
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698