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

Side by Side Diff: Tools/Scripts/webkitpy/tool/commands/rebaseline.py

Issue 23135008: Modify the rebaselining logic to handle skipped tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010 Google Inc. All rights reserved. 1 # Copyright (c) 2010 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 23 matching lines...) Expand all
34 import time 34 import time
35 import traceback 35 import traceback
36 import urllib 36 import urllib
37 import urllib2 37 import urllib2
38 38
39 from webkitpy.common.checkout.baselineoptimizer import BaselineOptimizer 39 from webkitpy.common.checkout.baselineoptimizer import BaselineOptimizer
40 from webkitpy.common.memoized import memoized 40 from webkitpy.common.memoized import memoized
41 from webkitpy.common.system.executive import ScriptError 41 from webkitpy.common.system.executive import ScriptError
42 from webkitpy.layout_tests.controllers.test_result_writer import TestResultWrite r 42 from webkitpy.layout_tests.controllers.test_result_writer import TestResultWrite r
43 from webkitpy.layout_tests.models import test_failures 43 from webkitpy.layout_tests.models import test_failures
44 from webkitpy.layout_tests.models.test_expectations import TestExpectations, BAS ELINE_SUFFIX_LIST 44 from webkitpy.layout_tests.models.test_expectations import TestExpectations, BAS ELINE_SUFFIX_LIST, SKIP
45 from webkitpy.layout_tests.port import builders 45 from webkitpy.layout_tests.port import builders
46 from webkitpy.layout_tests.port import factory 46 from webkitpy.layout_tests.port import factory
47 from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand 47 from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
48 48
49 49
50 _log = logging.getLogger(__name__) 50 _log = logging.getLogger(__name__)
51 51
52 52
53 # FIXME: Should TestResultWriter know how to compute this string? 53 # FIXME: Should TestResultWriter know how to compute this string?
54 def _baseline_name(fs, test_name, suffix): 54 def _baseline_name(fs, test_name, suffix):
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 old_baseline = port.expected_filename(test_name, "." + suffix) 145 old_baseline = port.expected_filename(test_name, "." + suffix)
146 if not self._tool.filesystem.exists(old_baseline): 146 if not self._tool.filesystem.exists(old_baseline):
147 _log.debug("No existing baseline for %s." % test_name) 147 _log.debug("No existing baseline for %s." % test_name)
148 continue 148 continue
149 149
150 new_baseline = self._tool.filesystem.join(port.baseline_path(), self ._file_name_for_expected_result(test_name, suffix)) 150 new_baseline = self._tool.filesystem.join(port.baseline_path(), self ._file_name_for_expected_result(test_name, suffix))
151 if self._tool.filesystem.exists(new_baseline): 151 if self._tool.filesystem.exists(new_baseline):
152 _log.debug("Existing baseline at %s, not copying over it." % new _baseline) 152 _log.debug("Existing baseline at %s, not copying over it." % new _baseline)
153 continue 153 continue
154 154
155 expectations = TestExpectations(port, [test_name])
156 if SKIP in expectations.get_expectations(test_name):
Dirk Pranke 2013/08/19 05:40:52 Ojan, do I need any other expectations in here (in
ojan 2013/08/19 06:05:27 If it's WontFix, we artificially add Skip at the m
157 _log.debug("%s is skipped on %s." % (test_name, port.name()))
158 continue
159
155 old_baselines.append(old_baseline) 160 old_baselines.append(old_baseline)
156 new_baselines.append(new_baseline) 161 new_baselines.append(new_baseline)
157 162
158 for i in range(len(old_baselines)): 163 for i in range(len(old_baselines)):
159 old_baseline = old_baselines[i] 164 old_baseline = old_baselines[i]
160 new_baseline = new_baselines[i] 165 new_baseline = new_baselines[i]
161 166
162 _log.debug("Copying baseline from %s to %s." % (old_baseline, new_ba seline)) 167 _log.debug("Copying baseline from %s to %s." % (old_baseline, new_ba seline))
163 self._tool.filesystem.maybe_make_directory(self._tool.filesystem.dir name(new_baseline)) 168 self._tool.filesystem.maybe_make_directory(self._tool.filesystem.dir name(new_baseline))
164 self._tool.filesystem.copyfile(old_baseline, new_baseline) 169 self._tool.filesystem.copyfile(old_baseline, new_baseline)
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 tool.executive.run_command(['git', 'pull']) 824 tool.executive.run_command(['git', 'pull'])
820 rebaseline_command = [tool.filesystem.join(tool.scm().checkout_r oot, 'Tools', 'Scripts', 'webkit-patch'), 'auto-rebaseline', '--log-server', 'bl inkrebaseline.appspot.com'] 825 rebaseline_command = [tool.filesystem.join(tool.scm().checkout_r oot, 'Tools', 'Scripts', 'webkit-patch'), 'auto-rebaseline', '--log-server', 'bl inkrebaseline.appspot.com']
821 if options.verbose: 826 if options.verbose:
822 rebaseline_command.append('--verbose') 827 rebaseline_command.append('--verbose')
823 # Use call instead of run_command so that stdout doesn't get swa llowed. 828 # Use call instead of run_command so that stdout doesn't get swa llowed.
824 tool.executive.call(rebaseline_command) 829 tool.executive.call(rebaseline_command)
825 except: 830 except:
826 traceback.print_exc(file=sys.stderr) 831 traceback.print_exc(file=sys.stderr)
827 832
828 time.sleep(self.SLEEP_TIME_IN_SECONDS) 833 time.sleep(self.SLEEP_TIME_IN_SECONDS)
OLDNEW
« no previous file with comments | « no previous file | Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698