diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-18 14:03:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-18 14:03:11 +0200 |
commit | 8d473cf9743f1d30a16a27114e93bd5af5648d23 (patch) | |
tree | cdca40d0353886b3ca52f33a2d7b8f1c0011aafc /Tools/Scripts/webkitpy | |
parent | 1b914638db989aaa98631a1c1e02c7b2d44805d8 (diff) | |
download | qtwebkit-8d473cf9743f1d30a16a27114e93bd5af5648d23.tar.gz |
Imported WebKit commit 1350e72f7345ced9da2bd9980deeeb5a8d62fab4 (http://svn.webkit.org/repository/webkit/trunk@117578)
Weekly snapshot
Diffstat (limited to 'Tools/Scripts/webkitpy')
16 files changed, 160 insertions, 91 deletions
diff --git a/Tools/Scripts/webkitpy/common/config/committers.py b/Tools/Scripts/webkitpy/common/config/committers.py index 68e2f0d4e..5b06e2234 100644 --- a/Tools/Scripts/webkitpy/common/config/committers.py +++ b/Tools/Scripts/webkitpy/common/config/committers.py @@ -229,6 +229,7 @@ committers_unable_to_review = [ Committer("Dominic Mazzoni", ["dmazzoni@google.com", "dmazzoni@chromium.org"], "dmazzoni"), Committer("Drew Wilson", "atwilson@chromium.org", "atwilson"), Committer("Eli Fidler", ["eli@staikos.net", "efidler@rim.com"], "efidler"), + Committer("Elliot Poger", "epoger@chromium.org", "epoger"), Committer("Emil A Eklund", "eae@chromium.org", "eae"), Committer("Erik Arvidsson", "arv@chromium.org", "arv"), Committer("Eric Roman", "eroman@chromium.org", "eroman"), @@ -245,6 +246,7 @@ committers_unable_to_review = [ Committer("Girish Ramakrishnan", ["girish@forwardbias.in", "ramakrishnan.girish@gmail.com"], "girishr"), Committer("Graham Dennis", ["Graham.Dennis@gmail.com", "gdennis@webkit.org"]), Committer("Greg Bolsinga", "bolsinga@apple.com"), + Committer("Grzegorz Czajkowski", "g.czajkowski@samsung.com", "grzegorz"), Committer("Gyuyoung Kim", ["gyuyoung.kim@samsung.com", "gyuyoung.kim@webkit.org"], "gyuyoung"), Committer("Hans Wennborg", "hans@chromium.org", "hwennborg"), Committer("Hayato Ito", "hayato@chromium.org", "hayato"), @@ -275,7 +277,7 @@ committers_unable_to_review = [ Committer("John Knottenbelt", "jknotten@chromium.org", "jknotten"), Committer("Johnny Ding", ["jnd@chromium.org", "johnnyding.webkit@gmail.com"], "johnnyding"), Committer("Jon Lee", "jonlee@apple.com", "jonlee"), - Committer("Joone Hur", ["joone.hur@collabora.co.uk", "joone@kldp.org", "joone@webkit.org"], "joone"), + Committer("Joone Hur", "joone@webkit.org", "joone"), Committer("Joost de Valk", ["joost@webkit.org", "webkit-dev@joostdevalk.nl"], "Altha"), Committer("Joshua Bell", ["jsbell@chromium.org", "jsbell@google.com"], "jsbell"), Committer("Julie Parent", ["jparent@google.com", "jparent@chromium.org"], "jparent"), @@ -373,10 +375,11 @@ committers_unable_to_review = [ Committer("Xiaomei Ji", "xji@chromium.org", "xji"), Committer("Yael Aharon", "yael.aharon@nokia.com", "yael"), Committer("Yaar Schnitman", ["yaar@chromium.org", "yaar@google.com"]), + Committer("Yi Shen", ["yi.4.shen@nokia.com", "shenyi2006@gmail.com"]), Committer("Yong Li", ["yong.li.webkit@gmail.com", "yong.li@torchmobile.com", "yoli@rim.com"], "yong"), Committer("Yongjun Zhang", ["yongjun.zhang@nokia.com", "yongjun_zhang@apple.com"]), + Committer("Yoshifumi Inoue", "yosin@chromium.org", "yosin"), Committer("Yuqiang Xian", "yuqiang.xian@intel.com"), - Committer("Yi Shen", ["yi.4.shen@nokia.com", "shenyi2006@gmail.com"]), Committer("Yuta Kitamura", "yutak@chromium.org", "yutak"), Committer("Yuzo Fujishima", "yuzo@google.com", "yuzo"), Committer("Zalan Bujtas", ["zbujtas@gmail.com", "zalan.bujtas@nokia.com"], "zalan"), diff --git a/Tools/Scripts/webkitpy/common/config/urls.py b/Tools/Scripts/webkitpy/common/config/urls.py index 48830c564..88ad373a1 100644 --- a/Tools/Scripts/webkitpy/common/config/urls.py +++ b/Tools/Scripts/webkitpy/common/config/urls.py @@ -47,7 +47,7 @@ bug_server_domain = "webkit.org" bug_server_host = "bugs." + bug_server_domain _bug_server_regex = "https?://%s/" % re.sub('\.', '\\.', bug_server_host) bug_server_url = "https://%s/" % bug_server_host -bug_url_long = _bug_server_regex + r"show_bug\.cgi\?id=(?P<bug_id>\d+)(&ctype=xml)?" +bug_url_long = _bug_server_regex + r"show_bug\.cgi\?id=(?P<bug_id>\d+)(&ctype=xml|&excludefield=attachmentdata)*" bug_url_short = r"https?\://%s/b/(?P<bug_id>\d+)" % bug_server_domain attachment_url = _bug_server_regex + r"attachment\.cgi\?id=(?P<attachment_id>\d+)(&action=(?P<action>\w+))?" diff --git a/Tools/Scripts/webkitpy/common/config/urls_unittest.py b/Tools/Scripts/webkitpy/common/config/urls_unittest.py index 74c224090..2b94b860e 100644 --- a/Tools/Scripts/webkitpy/common/config/urls_unittest.py +++ b/Tools/Scripts/webkitpy/common/config/urls_unittest.py @@ -37,10 +37,17 @@ class URLsTest(unittest.TestCase): self.assertEquals(12345, parse_bug_id("http://webkit.org/b/12345")) self.assertEquals(12345, parse_bug_id("foo\n\nhttp://webkit.org/b/12345\nbar\n\n")) self.assertEquals(12345, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?id=12345")) + self.assertEquals(12345, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?id=12345&ctype=xml")) + self.assertEquals(12345, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?id=12345&ctype=xml&excludefield=attachmentdata")) + self.assertEquals(12345, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?id=12345excludefield=attachmentdata&ctype=xml")) # Our url parser is super-fragile, but at least we're testing it. self.assertEquals(None, parse_bug_id("http://www.webkit.org/b/12345")) self.assertEquals(None, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?ctype=xml&id=12345")) + self.assertEquals(None, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?ctype=xml&id=12345&excludefield=attachmentdata")) + self.assertEquals(None, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?ctype=xml&excludefield=attachmentdata&id=12345")) + self.assertEquals(None, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?excludefield=attachmentdata&ctype=xml&id=12345")) + self.assertEquals(None, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?excludefield=attachmentdata&id=12345&ctype=xml")) def test_parse_attachment_id(self): self.assertEquals(12345, parse_attachment_id("https://bugs.webkit.org/attachment.cgi?id=12345&action=review")) diff --git a/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py b/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py index 6186a9559..1afa287de 100644 --- a/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py +++ b/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py @@ -308,7 +308,7 @@ class Bugzilla(object): def bug_url_for_bug_id(self, bug_id, xml=False): if not bug_id: return None - content_type = "&ctype=xml" if xml else "" + content_type = "&ctype=xml&excludefield=attachmentdata" if xml else "" return "%sshow_bug.cgi?id=%s%s" % (config_urls.bug_server_url, bug_id, content_type) def short_bug_url_for_bug_id(self, bug_id): diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py index d52f8819f..92edfe232 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py @@ -278,6 +278,28 @@ class PortTest(unittest.TestCase): [('/tmp/local-baselines', 'fast/test-expected.txt')]) self.assertEqual(port.baseline_path(), '/foo') + def test_additional_expectations(self): + port = self.make_port(port_name='foo') + + port._filesystem.write_text_file( + '/tmp/additional-expectations-1.txt', 'content1\n') + port._filesystem.write_text_file( + '/tmp/additional-expectations-2.txt', 'content2\n') + + self.assertEquals(None, port.test_expectations_overrides()) + + port._options.additional_expectations = [ + '/tmp/additional-expectations-1.txt'] + self.assertEquals('content1\n', port.test_expectations_overrides()) + + port._options.additional_expectations = [ + '/tmp/nonexistent-file', '/tmp/additional-expectations-1.txt'] + self.assertEquals('content1\n', port.test_expectations_overrides()) + + port._options.additional_expectations = [ + '/tmp/additional-expectations-1.txt', '/tmp/additional-expectations-2.txt'] + self.assertEquals('content1\ncontent2\n', port.test_expectations_overrides()) + def test_uses_test_expectations_file(self): port = self.make_port(port_name='foo') port.path_to_test_expectations_file = lambda: '/mock-results/test_expectations.txt' diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py index c912a0ef2..39ed0fca3 100755 --- a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py @@ -420,11 +420,11 @@ class ChromiumDriver(WebKitDriver): self._image_path = None # FIXME: Delete all of this driver code once we're satisfied that it's not needed any more. - if port.host.platform.os_version == 'snowleopard': - if not hasattr(port._options, 'additional_drt_flag'): - port._options.additional_drt_flag = [] - if not '--test-shell' in port._options.additional_drt_flag: - port._options.additional_drt_flag.append('--test-shell') + #if port.host.platform.os_version == 'snowleopard': + # if not hasattr(port._options, 'additional_drt_flag'): + # port._options.additional_drt_flag = [] + # if not '--test-shell' in port._options.additional_drt_flag: + # port._options.additional_drt_flag.append('--test-shell') self._test_shell = '--test-shell' in port.get_option('additional_drt_flag', []) diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py index 026f81162..d2591ae4e 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py @@ -290,18 +290,40 @@ class ChromiumPortTest(port_testcase.PortTestCase): port._filesystem = filesystem port.path_from_chromium_base = lambda *comps: '/' + '/'.join(comps) - overrides_path = port.path_from_chromium_base('webkit', 'tools', 'layout_tests', 'test_expectations.txt') - OVERRIDES = 'foo' - filesystem.files[overrides_path] = OVERRIDES + chromium_overrides_path = port.path_from_chromium_base( + 'webkit', 'tools', 'layout_tests', 'test_expectations.txt') + CHROMIUM_OVERRIDES = 'contents of %s\n' % chromium_overrides_path + + filesystem.write_text_file(chromium_overrides_path, CHROMIUM_OVERRIDES) + + additional_expectations_path = port.path_from_chromium_base( + 'additional_expectations.txt') + ADDITIONAL_EXPECTATIONS = 'contents of %s\n' % additional_expectations_path + filesystem.write_text_file(additional_expectations_path, ADDITIONAL_EXPECTATIONS) port._options.builder_name = 'DUMMY_BUILDER_NAME' - self.assertEquals(port.test_expectations_overrides(), OVERRIDES) + port._options.additional_expectations = [] + self.assertEquals(port.test_expectations_overrides(), + CHROMIUM_OVERRIDES) + port._options.additional_expectations = [additional_expectations_path] + self.assertEquals(port.test_expectations_overrides(), + CHROMIUM_OVERRIDES + ADDITIONAL_EXPECTATIONS) port._options.builder_name = 'builder (deps)' - self.assertEquals(port.test_expectations_overrides(), OVERRIDES) + port._options.additional_expectations = [] + self.assertEquals(port.test_expectations_overrides(), + CHROMIUM_OVERRIDES) + port._options.additional_expectations = [additional_expectations_path] + self.assertEquals(port.test_expectations_overrides(), + CHROMIUM_OVERRIDES + ADDITIONAL_EXPECTATIONS) port._options.builder_name = 'builder' - self.assertEquals(port.test_expectations_overrides(), None) + port._options.additional_expectations = [] + self.assertEquals(port.test_expectations_overrides(), + None) + port._options.additional_expectations = [additional_expectations_path] + self.assertEquals(port.test_expectations_overrides(), + ADDITIONAL_EXPECTATIONS) class ChromiumPortLoggingTest(logtesting.LoggingTestCase): diff --git a/Tools/Scripts/webkitpy/layout_tests/port/gtk.py b/Tools/Scripts/webkitpy/layout_tests/port/gtk.py index 5e4e1a2ea..26e1c84fb 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/gtk.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/gtk.py @@ -125,8 +125,9 @@ class GtkPort(WebKitPort, PulseAudioSanitizer): cmd = ['gdb', '-ex', 'thread apply all bt', '--batch', str(self._path_to_driver()), coredump_path] proc = subprocess.Popen(cmd, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) proc.wait() - errors = [l.strip() for l in proc.stderr.readlines()] - return (proc.stdout.read(), errors) + errors = [l.strip().decode('utf8', 'ignore') for l in proc.stderr.readlines()] + trace = proc.stdout.read().decode('utf8', 'ignore') + return (trace, errors) def _get_crash_log(self, name, pid, stdout, stderr, newer_than): pid_representation = str(pid or '<unknown>') diff --git a/Tools/Scripts/webkitpy/layout_tests/port/webkit.py b/Tools/Scripts/webkitpy/layout_tests/port/webkit.py index ade7d038e..0965b44a4 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/webkit.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/webkit.py @@ -300,6 +300,7 @@ class WebKitPort(Port): "WebCoreHas3DRendering": ["animations/3d", "transforms/3d"], "WebGLShader": ["fast/canvas/webgl", "compositing/webgl", "http/tests/canvas/webgl"], "MHTMLArchive": ["mhtml"], + "CSSVariableValue": ["fast/css/variables"], } def _has_test_in_directories(self, directory_lists, test_list): diff --git a/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py index 63502a570..09916ba4e 100755 --- a/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py @@ -107,6 +107,7 @@ class WebKitPortTest(port_testcase.PortTestCase): "compositing/webgl", # Requires WebGLShader "http/tests/canvas/webgl", # Requires WebGLShader "mhtml", # Requires MHTMLArchive + "fast/css/variables", # Requires CSS Variables ]) result_directories = set(TestWebKitPort(symbols_string, None)._skipped_tests_for_unsupported_features(test_list=['mathml/foo.html'])) @@ -119,7 +120,7 @@ class WebKitPortTest(port_testcase.PortTestCase): 000000000124f670 s __ZZN7WebCore13GraphicsLayer13addChildBelowEPS0_S1_E19__PRETTY_FUNCTION__ """ # Note 'compositing' is not in the list of skipped directories (hence the parsing of GraphicsLayer worked): - expected_directories = set(['mathml', 'transforms/3d', 'compositing/webgl', 'fast/canvas/webgl', 'animations/3d', 'mhtml', 'http/tests/canvas/webgl']) + expected_directories = set(['mathml', 'transforms/3d', 'compositing/webgl', 'fast/canvas/webgl', 'animations/3d', 'mhtml', 'http/tests/canvas/webgl', 'fast/css/variables']) result_directories = set(TestWebKitPort(symbols_string, None)._skipped_tests_for_unsupported_features(test_list=['mathml/foo.html'])) self.assertEqual(result_directories, expected_directories) diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py index 8e430cd94..de5eeb84a 100755 --- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py +++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py @@ -252,7 +252,7 @@ def parse_args(args=None): optparse.make_option("-l", "--leaks", action="store_true", default=False, help="Enable leaks checking (Mac OS X only)"), optparse.make_option("-g", "--guard-malloc", action="store_true", default=False, - help="Enable malloc guard (Mac OS X only)"), + help="Enable Guard Malloc (Mac OS X only)"), optparse.make_option("--threaded", action="store_true", default=False, help="Run a concurrent JavaScript thread with each test"), optparse.make_option("--webkit-test-runner", "-2", action="store_true", diff --git a/Tools/Scripts/webkitpy/performance_tests/perftest.py b/Tools/Scripts/webkitpy/performance_tests/perftest.py index 509dd1d2b..a81c47880 100644 --- a/Tools/Scripts/webkitpy/performance_tests/perftest.py +++ b/Tools/Scripts/webkitpy/performance_tests/perftest.py @@ -74,7 +74,7 @@ class PerfTest(object): re.compile(r'^Running \d+ times$'), re.compile(r'^Ignoring warm-up '), re.compile(r'^Info:'), - re.compile(r'^\d+(.\d+)?$'), + re.compile(r'^\d+(.\d+)?(\s*(runs\/s|ms))?$'), # Following are for handle existing test like Dromaeo re.compile(re.escape("""main frame - has 1 onunload handler(s)""")), re.compile(re.escape("""frame "<!--framePath //<!--frame0-->-->" - has 1 onunload handler(s)""")), @@ -95,9 +95,16 @@ class PerfTest(object): test_failed = False results = {} score_regex = re.compile(r'^(?P<key>' + r'|'.join(self._statistics_keys) + r')\s+(?P<value>[0-9\.]+)\s*(?P<unit>.*)') + description_regex = re.compile(r'^Description: (?P<description>.*)$', re.IGNORECASE) + description_string = "" unit = "ms" for line in re.split('\n', output.text): + description = description_regex.match(line) + if description: + description_string = description.group('description') + continue + score = score_regex.match(line) if score: results[score.group('key')] = float(score.group('value')) @@ -115,12 +122,14 @@ class PerfTest(object): results['unit'] = unit test_name = re.sub(r'\.\w+$', '', self._test_name) - self.output_statistics(test_name, results) + self.output_statistics(test_name, results, description_string) return {test_name: results} - def output_statistics(self, test_name, results): + def output_statistics(self, test_name, results, description_string): unit = results['unit'] + if description_string: + _log.info('DESCRIPTION: %s' % description_string) _log.info('RESULT %s= %s %s' % (test_name.replace('/', ': '), results['avg'], unit)) _log.info(', '.join(['%s= %s %s' % (key, results[key], unit) for key in self._statistics_keys[1:]])) @@ -181,7 +190,7 @@ class PageLoadingPerfTest(PerfTest): 'median': test_times[middle] if len(test_times) % 2 else (test_times[middle - 1] + test_times[middle]) / 2, 'stdev': math.sqrt(squareSum), 'unit': 'ms'} - self.output_statistics(self.test_name(), results) + self.output_statistics(self.test_name(), results, '') return {self.test_name(): results} diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py index fc118949c..b375e8e05 100644 --- a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py +++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py @@ -38,7 +38,6 @@ from webkitpy.common.net.buildbot import BuildBot from webkitpy.common.net.layouttestresults import LayoutTestResults from webkitpy.common.system.executive import ScriptError from webkitpy.common.system.user import User -from webkitpy.common.system.zipfileset import ZipFileSet from webkitpy.layout_tests.controllers.test_result_writer import TestResultWriter from webkitpy.layout_tests.models import test_failures from webkitpy.layout_tests.models.test_configuration import TestConfiguration @@ -48,6 +47,7 @@ from webkitpy.tool.grammar import pluralize from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand +# FIXME: Pull this from Port.baseline_extensions(). _baseline_suffix_list = ['png', 'wav', 'txt'] @@ -56,18 +56,24 @@ def _baseline_name(fs, test_name, suffix): return fs.splitext(test_name)[0] + TestResultWriter.FILENAME_SUFFIX_EXPECTED + "." + suffix -class RebaselineTest(AbstractDeclarativeCommand): +class AbstractRebaseliningCommand(AbstractDeclarativeCommand): + def __init__(self): + options = [ + optparse.make_option('--suffixes', default=','.join(_baseline_suffix_list), action='store', + help='file types to rebaseline')] + AbstractDeclarativeCommand.__init__(self, options=options) + self._baseline_suffix_list = _baseline_suffix_list + + +class RebaselineTest(AbstractRebaseliningCommand): name = "rebaseline-test" help_text = "Rebaseline a single test from a buildbot. (Currently works only with build.chromium.org buildbots.)" argument_names = "BUILDER_NAME TEST_NAME [PLATFORMS_TO_MOVE_EXISTING_BASELINES_TO]" - def __init__(self, options=None, **kwargs): - super(RebaselineTest, self).__init__(options, **kwargs) - self._zip_file_sets = {} - - def _results_zip_url(self, builder_name): + def _results_url(self, builder_name): # FIXME: Generalize this command to work with non-build.chromium.org builders. - return self._tool.chromium_buildbot().builder_with_name(builder_name).accumulated_results_url().replace('results/layout-test-results', 'layout-test-results.zip') + builder = self._tool.chromium_buildbot().builder_with_name(builder_name) + return builder.accumulated_results_url() def _baseline_directory(self, builder_name): port = self._tool.port_factory.get_from_builder_name(builder_name) @@ -133,42 +139,27 @@ class RebaselineTest(AbstractDeclarativeCommand): def _file_name_for_expected_result(self, test_name, suffix): return "%s-expected.%s" % (self._test_root(test_name), suffix) - def _zip_file_set(self, url): - return ZipFileSet(url) - - def _fetch_baseline(self, builder_name, test_name, suffix): - # FIXME: See https://bugs.webkit.org/show_bug.cgi?id=84762 ... fetching the whole - # zip file and then extracting individual results is much slower than just fetching - # the result directly from the buildbot, but it guarantees that we are getting correct results. - member_name = self._file_name_for_actual_result(test_name, suffix) - zip_url = self._results_zip_url(builder_name) - if not builder_name in self._zip_file_sets: - print "Retrieving " + zip_url - self._zip_file_sets[builder_name] = self._zip_file_set(zip_url) - - try: - data = self._zip_file_sets[builder_name].read('layout-test-results/' + member_name) - print " Found " + member_name - return data - except KeyError, e: - return None - def _rebaseline_test(self, builder_name, test_name, platforms_to_move_existing_baselines_to, suffix): + results_url = self._results_url(builder_name) baseline_directory = self._baseline_directory(builder_name) + source_baseline = "%s/%s" % (results_url, self._file_name_for_actual_result(test_name, suffix)) target_baseline = self._tool.filesystem.join(baseline_directory, self._file_name_for_expected_result(test_name, suffix)) if platforms_to_move_existing_baselines_to: self._copy_existing_baseline(platforms_to_move_existing_baselines_to, test_name, suffix) - self._save_baseline(self._fetch_baseline(builder_name, test_name, suffix), target_baseline) + print "Retrieving %s." % source_baseline + self._save_baseline(self._tool.web.get_binary(source_baseline, convert_404_to_None=True), target_baseline) def _rebaseline_test_and_update_expectations(self, builder_name, test_name, platforms_to_move_existing_baselines_to): - for suffix in _baseline_suffix_list: + for suffix in self._baseline_suffix_list: self._rebaseline_test(builder_name, test_name, platforms_to_move_existing_baselines_to, suffix) self._update_expectations_file(builder_name, test_name) def execute(self, options, args, tool): + self._baseline_suffix_list = options.suffixes.split(',') + if len(args) > 2: platforms_to_move_existing_baselines_to = args[2:] else: @@ -176,18 +167,19 @@ class RebaselineTest(AbstractDeclarativeCommand): self._rebaseline_test_and_update_expectations(args[0], args[1], platforms_to_move_existing_baselines_to) -class OptimizeBaselines(AbstractDeclarativeCommand): +class OptimizeBaselines(AbstractRebaseliningCommand): name = "optimize-baselines" help_text = "Reshuffles the baselines for the given tests to use as litte space on disk as possible." argument_names = "TEST_NAMES" def _optimize_baseline(self, test_name): - for suffix in _baseline_suffix_list: + for suffix in self._baseline_suffix_list: baseline_name = _baseline_name(self._tool.filesystem, test_name, suffix) if not self._baseline_optimizer.optimize(baseline_name): print "Hueristics failed to optimize %s" % baseline_name def execute(self, options, args, tool): + self._baseline_suffix_list = options.suffixes.split(',') self._baseline_optimizer = BaselineOptimizer(tool) self._port = tool.port_factory.get("chromium-win-win7") # FIXME: This should be selectable. @@ -196,7 +188,7 @@ class OptimizeBaselines(AbstractDeclarativeCommand): self._optimize_baseline(test_name) -class AnalyzeBaselines(AbstractDeclarativeCommand): +class AnalyzeBaselines(AbstractRebaseliningCommand): name = "analyze-baselines" help_text = "Analyzes the baselines for the given tests and prints results that are identical." argument_names = "TEST_NAMES" @@ -209,12 +201,13 @@ class AnalyzeBaselines(AbstractDeclarativeCommand): print ' '.join(results_names) def _analyze_baseline(self, test_name): - for suffix in _baseline_suffix_list: + for suffix in self._baseline_suffix_list: baseline_name = _baseline_name(self._tool.filesystem, test_name, suffix) directories_by_result = self._baseline_optimizer.directories_by_result(baseline_name) self._print(baseline_name, directories_by_result) def execute(self, options, args, tool): + self._baseline_suffix_list = options.suffixes.split(',') self._baseline_optimizer = BaselineOptimizer(tool) self._port = tool.port_factory.get("chromium-win-win7") # FIXME: This should be selectable. @@ -269,6 +262,7 @@ class RebaselineExpectations(AbstractDeclarativeCommand): for test_name in self._tests_to_rebaseline(self._tool.port_factory.get(port_name)): self._touched_test_names.add(test_name) print " %s" % test_name + # FIXME: need to extract the correct list of suffixes here. self._run_webkit_patch(['rebaseline-test', builder_name, test_name]) def execute(self, options, args, tool): diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py index f5f7db52a..46d9ed47b 100644 --- a/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py +++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py @@ -36,20 +36,6 @@ from webkitpy.common.system.executive_mock import MockExecutive class TestRebaseline(unittest.TestCase): - def stub_rebaseline_test_command_and_tool(self): - - class FakeZipFileSet(object): - contents = {} - - def read(self, member): - return self.contents[member] - - command = RebaselineTest() - tool = MockTool() - command.bind_to_tool(tool) - command._zip_file_set = lambda url: FakeZipFileSet() - return (command, tool) - def test_tests_to_update(self): command = Rebaseline() command.bind_to_tool(MockTool()) @@ -57,7 +43,10 @@ class TestRebaseline(unittest.TestCase): OutputCapture().assert_outputs(self, command._tests_to_update, [build]) def test_rebaseline_updates_expectations_file_noop(self): - command, tool = self.stub_rebaseline_test_command_and_tool() + command = RebaselineTest() + tool = MockTool() + command.bind_to_tool(tool) + lion_port = tool.port_factory.get_from_builder_name("Webkit Mac10.7") tool.filesystem.write_text_file(lion_port.path_to_test_expectations_file(), """BUGB MAC LINUX XP DEBUG : fast/dom/Window/window-postmessage-clone-really-deep-array.html = PASS BUGA DEBUG : fast/css/large-list-of-rules-crash.html = TEXT @@ -66,7 +55,10 @@ BUGA DEBUG : fast/css/large-list-of-rules-crash.html = TEXT tool.filesystem.write_text_file(os.path.join(lion_port.layout_tests_dir(), "fast/css/large-list-of-rules-crash.html"), "Dummy test contents") tool.filesystem.write_text_file(os.path.join(lion_port.layout_tests_dir(), "userscripts/another-test.html"), "Dummy test contents") - expected_stdout = "Retrieving http://example.com/f/builders/Webkit Mac10.7/layout-test-results.zip\n" + expected_stdout = """Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-results/userscripts/another-test-actual.png. +Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-results/userscripts/another-test-actual.wav. +Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-results/userscripts/another-test-actual.txt. +""" OutputCapture().assert_outputs(self, command._rebaseline_test_and_update_expectations, ["Webkit Mac10.7", "userscripts/another-test.html", None], expected_stdout=expected_stdout) new_expectations = tool.filesystem.read_text_file(lion_port.path_to_test_expectations_file()) @@ -75,56 +67,70 @@ BUGA DEBUG : fast/css/large-list-of-rules-crash.html = TEXT """) def test_rebaseline_updates_expectations_file(self): - command, tool = self.stub_rebaseline_test_command_and_tool() + command = RebaselineTest() + tool = MockTool() + command.bind_to_tool(tool) lion_port = tool.port_factory.get_from_builder_name("Webkit Mac10.7") tool.filesystem.write_text_file(lion_port.path_to_test_expectations_file(), "BUGX MAC : userscripts/another-test.html = IMAGE\nBUGZ LINUX : userscripts/another-test.html = IMAGE\n") tool.filesystem.write_text_file(os.path.join(lion_port.layout_tests_dir(), "userscripts/another-test.html"), "Dummy test contents") - expected_stdout = "Retrieving http://example.com/f/builders/Webkit Mac10.7/layout-test-results.zip\n" + expected_stdout = """Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-results/userscripts/another-test-actual.png. +Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-results/userscripts/another-test-actual.wav. +Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-results/userscripts/another-test-actual.txt. +""" OutputCapture().assert_outputs(self, command._rebaseline_test_and_update_expectations, ["Webkit Mac10.7", "userscripts/another-test.html", None], expected_stdout=expected_stdout) new_expectations = tool.filesystem.read_text_file(lion_port.path_to_test_expectations_file()) self.assertEqual(new_expectations, "BUGX LEOPARD SNOWLEOPARD : userscripts/another-test.html = IMAGE\nBUGZ LINUX : userscripts/another-test.html = IMAGE\n") def test_rebaseline_test(self): - command, _ = self.stub_rebaseline_test_command_and_tool() - expected_stdout = "Retrieving http://example.com/f/builders/Webkit Linux/layout-test-results.zip\n" + command = RebaselineTest() + command.bind_to_tool(MockTool()) + expected_stdout = "Retrieving http://example.com/f/builders/Webkit Linux/results/layout-test-results/userscripts/another-test-actual.txt.\n" OutputCapture().assert_outputs(self, command._rebaseline_test, ["Webkit Linux", "userscripts/another-test.html", None, "txt"], expected_stdout=expected_stdout) def test_rebaseline_and_copy_test(self): - command, tool = self.stub_rebaseline_test_command_and_tool() + command = RebaselineTest() + tool = MockTool() + command.bind_to_tool(tool) lion_port = tool.port_factory.get_from_builder_name("Webkit Mac10.7") tool.filesystem.write_text_file(os.path.join(lion_port.layout_tests_dir(), "userscripts/another-test-expected.txt"), "Dummy expected result") expected_stdout = """Copying baseline from /mock-checkout/LayoutTests/userscripts/another-test-expected.txt to /mock-checkout/LayoutTests/platform/chromium-mac-snowleopard/userscripts/another-test-expected.txt. -Retrieving http://example.com/f/builders/Webkit Mac10.7/layout-test-results.zip +Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-results/userscripts/another-test-actual.txt. """ OutputCapture().assert_outputs(self, command._rebaseline_test, ["Webkit Mac10.7", "userscripts/another-test.html", ["chromium-mac-snowleopard"], "txt"], expected_stdout=expected_stdout) def test_rebaseline_and_copy_test_no_existing_result(self): - command, _ = self.stub_rebaseline_test_command_and_tool() + command = RebaselineTest() + tool = MockTool() + command.bind_to_tool(tool) expected_stdout = """No existing baseline for userscripts/another-test.html. -Retrieving http://example.com/f/builders/Webkit Mac10.7/layout-test-results.zip +Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-results/userscripts/another-test-actual.txt. """ OutputCapture().assert_outputs(self, command._rebaseline_test, ["Webkit Mac10.7", "userscripts/another-test.html", ["chromium-mac-snowleopard"], "txt"], expected_stdout=expected_stdout) def test_rebaseline_and_copy_test_with_lion_result(self): - command, tool = self.stub_rebaseline_test_command_and_tool() + command = RebaselineTest() + tool = MockTool() + command.bind_to_tool(tool) lion_port = tool.port_factory.get_from_builder_name("Webkit Mac10.7") tool.filesystem.write_text_file(os.path.join(lion_port.baseline_path(), "userscripts/another-test-expected.txt"), "Dummy expected result") expected_stdout = """Copying baseline from /mock-checkout/LayoutTests/platform/chromium-mac/userscripts/another-test-expected.txt to /mock-checkout/LayoutTests/platform/chromium-mac-snowleopard/userscripts/another-test-expected.txt. Copying baseline from /mock-checkout/LayoutTests/platform/chromium-mac/userscripts/another-test-expected.txt to /mock-checkout/LayoutTests/platform/chromium-mac-leopard/userscripts/another-test-expected.txt. -Retrieving http://example.com/f/builders/Webkit Mac10.7/layout-test-results.zip +Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-results/userscripts/another-test-actual.txt. """ OutputCapture().assert_outputs(self, command._rebaseline_test, ["Webkit Mac10.7", "userscripts/another-test.html", ["chromium-mac-snowleopard", "chromium-mac-leopard"], "txt"], expected_stdout=expected_stdout) def test_rebaseline_and_copy_no_overwrite_test(self): - command, tool = self.stub_rebaseline_test_command_and_tool() + command = RebaselineTest() + tool = MockTool() + command.bind_to_tool(tool) lion_port = tool.port_factory.get_from_builder_name("Webkit Mac10.7") tool.filesystem.write_text_file(os.path.join(lion_port.baseline_path(), "userscripts/another-test-expected.txt"), "Dummy expected result") @@ -133,7 +139,7 @@ Retrieving http://example.com/f/builders/Webkit Mac10.7/layout-test-results.zip tool.filesystem.write_text_file(os.path.join(snowleopard_port.baseline_path(), "userscripts/another-test-expected.txt"), "Dummy expected result") expected_stdout = """Existing baseline at /mock-checkout/LayoutTests/platform/chromium-mac-snowleopard/userscripts/another-test-expected.txt, not copying over it. -Retrieving http://example.com/f/builders/Webkit Mac10.7/layout-test-results.zip +Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-results/userscripts/another-test-actual.txt. """ OutputCapture().assert_outputs(self, command._rebaseline_test, ["Webkit Mac10.7", "userscripts/another-test.html", ["chromium-mac-snowleopard"], "txt"], expected_stdout=expected_stdout) diff --git a/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py b/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py index 3d09b5f76..f43402897 100644 --- a/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py +++ b/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py @@ -139,8 +139,10 @@ class GardeningHTTPRequestHandler(ReflectionHandler): builder = self.query['builder'][0] command = [ 'rebaseline-test', + '--suffixes', self.query['suffixes'][0], builder, self.query['test'][0], + ] command.extend(builders.fallback_port_names_for_new_port(builder)) self._run_webkit_patch(command) @@ -150,6 +152,7 @@ class GardeningHTTPRequestHandler(ReflectionHandler): test = self.query['test'][0] self._run_webkit_patch([ 'optimize-baselines', + '--suffixes', self.query['suffixes'][0], test, ]) self._serve_text('success') diff --git a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py index 13e9001b7..c96b66034 100644 --- a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py +++ b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py @@ -183,20 +183,20 @@ class GardeningServerTest(unittest.TestCase): def test_rebaseline(self): builders._exact_matches = {"MOCK builder": {"port_name": "mock-port-name", "specifiers": set(["mock-specifier"])}} - expected_stderr = "MOCK run_command: ['echo', 'rebaseline-test', 'MOCK builder', 'user-scripts/another-test.html'], cwd=/mock-checkout\n" + expected_stderr = "MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt,png', 'MOCK builder', 'user-scripts/another-test.html'], cwd=/mock-checkout\n" expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n" - self._post_to_path("/rebaseline?builder=MOCK+builder&test=user-scripts/another-test.html", expected_stderr=expected_stderr, expected_stdout=expected_stdout) + self._post_to_path("/rebaseline?builder=MOCK+builder&test=user-scripts/another-test.html&suffixes=txt,png", expected_stderr=expected_stderr, expected_stdout=expected_stdout) def test_rebaseline_new_port(self): builders._exact_matches = {"MOCK builder": {"port_name": "mock-port-name", "specifiers": set(["mock-specifier"]), "move_overwritten_baselines_to": ["mock-port-fallback", "mock-port-fallback2"]}} - expected_stderr = "MOCK run_command: ['echo', 'rebaseline-test', 'MOCK builder', 'user-scripts/another-test.html', 'mock-port-fallback', 'mock-port-fallback2'], cwd=/mock-checkout\n" + expected_stderr = "MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt,png', 'MOCK builder', 'user-scripts/another-test.html', 'mock-port-fallback', 'mock-port-fallback2'], cwd=/mock-checkout\n" expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n" - self._post_to_path("/rebaseline?builder=MOCK+builder&test=user-scripts/another-test.html", expected_stderr=expected_stderr, expected_stdout=expected_stdout) + self._post_to_path("/rebaseline?builder=MOCK+builder&test=user-scripts/another-test.html&suffixes=txt,png", expected_stderr=expected_stderr, expected_stdout=expected_stdout) def test_optimizebaselines(self): - expected_stderr = "MOCK run_command: ['echo', 'optimize-baselines', 'user-scripts/another-test.html'], cwd=/mock-checkout\n" + expected_stderr = "MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt,png', 'user-scripts/another-test.html'], cwd=/mock-checkout\n" expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n" - self._post_to_path("/optimizebaselines?test=user-scripts/another-test.html", expected_stderr=expected_stderr, expected_stdout=expected_stdout) + self._post_to_path("/optimizebaselines?test=user-scripts/another-test.html&suffixes=txt,png", expected_stderr=expected_stderr, expected_stdout=expected_stdout) def test_updateexpectations(self): expected_stderr = "" |