Diff
Modified: trunk/Tools/ChangeLog (92562 => 92563)
--- trunk/Tools/ChangeLog 2011-08-06 22:17:24 UTC (rev 92562)
+++ trunk/Tools/ChangeLog 2011-08-06 22:19:39 UTC (rev 92563)
@@ -1,5 +1,30 @@
2011-08-06 Adam Barth <[email protected]>
+ Remove dead code in webkitpy
+ https://bugs.webkit.org/show_bug.cgi?id=65818
+
+ Reviewed by Dimitri Glazkov.
+
+ This code was added to support the rebaseline2 command six months ago,
+ but the rebaseline2 command was never finished and no one else has used
+ this code since it was landed. This patch removes the dead code. If
+ we revive rebaseline2, then we can revert this patch and recover the
+ code. Until then, this code is just dead weight.
+
+ * Scripts/webkitpy/common/net/buildbot/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py:
+ * Scripts/webkitpy/common/net/testoutput.py: Removed.
+ * Scripts/webkitpy/common/net/testoutput_unittest.py: Removed.
+ * Scripts/webkitpy/common/net/testoutputset.py: Removed.
+ * Scripts/webkitpy/common/net/testoutputset_unittest.py: Removed.
+ * Scripts/webkitpy/common/system/directoryfileset.py: Removed.
+ * Scripts/webkitpy/common/system/directoryfileset_unittest.py: Removed.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+
+2011-08-06 Adam Barth <[email protected]>
+
webkit-patch optimize-baselines can't handle promotions to base results directory
https://bugs.webkit.org/show_bug.cgi?id=65819
Modified: trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot.py (92562 => 92563)
--- trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot.py 2011-08-06 22:17:24 UTC (rev 92562)
+++ trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot.py 2011-08-06 22:19:39 UTC (rev 92563)
@@ -44,9 +44,7 @@
from webkitpy.common.net.layouttestresults import LayoutTestResults
from webkitpy.common.net.networktransaction import NetworkTransaction
from webkitpy.common.net.regressionwindow import RegressionWindow
-from webkitpy.common.net.testoutputset import TestOutputSet
from webkitpy.common.system.logutils import get_logger
-from webkitpy.common.system.zipfileset import ZipFileSet
from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup
@@ -244,9 +242,6 @@
def results_zip_url(self):
return "%s.zip" % self.results_url()
- def results(self):
- return TestOutputSet(self._builder.name(), None, ZipFileSet(self.results_zip_url()), include_expected=False)
-
def _fetch_file_from_results(self, file_name):
# It seems this can return None if the url redirects and then returns 404.
result = urllib2.urlopen("%s/%s" % (self.results_url(), file_name))
Modified: trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py (92562 => 92563)
--- trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py 2011-08-06 22:17:24 UTC (rev 92562)
+++ trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py 2011-08-06 22:19:39 UTC (rev 92563)
@@ -467,11 +467,6 @@
b.results_url = self.results_url
self.assertEquals("some-url.zip", b.results_zip_url())
- def test_results(self):
- builder = Builder('builder', BuildBot())
- b = Build(builder, 123, 123, True)
- self.assertTrue(b.results())
-
if __name__ == '__main__':
unittest.main()
Deleted: trunk/Tools/Scripts/webkitpy/common/net/testoutput.py (92562 => 92563)
--- trunk/Tools/Scripts/webkitpy/common/net/testoutput.py 2011-08-06 22:17:24 UTC (rev 92562)
+++ trunk/Tools/Scripts/webkitpy/common/net/testoutput.py 2011-08-06 22:19:39 UTC (rev 92563)
@@ -1,179 +0,0 @@
-#!/usr/bin/env python
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import re
-
-
-class NaiveImageDiffer(object):
- def same_image(self, img1, img2):
- return img1 == img2
-
-
-class TestOutput(object):
- """Represents the output that a single layout test generates when it is run
- on a particular platform.
- Note that this is the raw output that is produced when the layout test is
- run, not the results of the subsequent comparison between that output and
- the expected output."""
- def __init__(self, platform, output_type, files):
- self._output_type = output_type
- self._files = files
- file = files[0] # Pick some file to do test name calculation.
- self._name = self._extract_test_name(file.name())
- self._is_actual = '-actual.' in file.name()
-
- self._platform = platform or self._extract_platform(file.name())
-
- def _extract_platform(self, filename):
- """Calculates the platform from the name of the file if it isn't known already"""
- path = filename.split(os.path.sep)
- if 'platform' in path:
- return path[path.index('platform') + 1]
- return None
-
- def _extract_test_name(self, filename):
- path = filename.split(os.path.sep)
- if 'LayoutTests' in path:
- path = path[1 + path.index('LayoutTests'):]
- if 'layout-test-results' in path:
- path = path[1 + path.index('layout-test-results'):]
- if 'platform' in path:
- path = path[2 + path.index('platform'):]
-
- filename = path[-1]
- filename = re.sub('-expected\..*$', '', filename)
- filename = re.sub('-actual\..*$', '', filename)
- path[-1] = filename
- return os.path.sep.join(path)
-
- def save_to(self, path):
- """Have the files in this TestOutput write themselves to the disk at the specified location."""
- for file in self._files:
- file.save_to(path)
-
- def is_actual(self):
- """Is this output the actual output of a test? (As opposed to expected output.)"""
- return self._is_actual
-
- def name(self):
- """The name of this test (doesn't include extension)"""
- return self._name
-
- def __eq__(self, other):
- return (other != None and
- self.name() == other.name() and
- self.type() == other.type() and
- self.platform() == other.platform() and
- self.is_actual() == other.is_actual() and
- self.same_content(other))
-
- def __hash__(self):
- return hash(str(self.name()) + str(self.type()) + str(self.platform()))
-
- def is_new_baseline_for(self, other):
- return (self.name() == other.name() and
- self.type() == other.type() and
- self.platform() == other.platform() and
- self.is_actual() and
- (not other.is_actual()))
-
- def __str__(self):
- actual_str = '[A] ' if self.is_actual() else ''
- return "TestOutput[%s/%s] %s%s" % (self._platform, self._output_type, actual_str, self.name())
-
- def type(self):
- return self._output_type
-
- def platform(self):
- return self._platform
-
- def _path_to_platform(self):
- """Returns the path that tests for this platform are stored in."""
- if self._platform is None:
- return ""
- else:
- return os.path.join("self._platform", self._platform)
-
- def _save_expected_result(self, file, path):
- path = os.path.join(path, self._path_to_platform())
- extension = os.path.splitext(file.name())[1]
- filename = self.name() + '-expected' + extension
- file.save_to(path, filename)
-
- def save_expected_results(self, path_to_layout_tests):
- """Save the files of this TestOutput to the appropriate directory
- inside the LayoutTests directory. Typically this means that these files
- will be saved in "LayoutTests/platform/<platform>/, or simply
- LayoutTests if the platform is None."""
- for file in self._files:
- self._save_expected_result(file, path_to_layout_tests)
-
- def delete(self):
- """Deletes the files that comprise this TestOutput from disk. This
- fails if the files are virtual files (eg: the files may reside inside a
- remote zip file)."""
- for file in self._files:
- file.delete()
-
-
-class TextTestOutput(TestOutput):
- """Represents a text output of a single test on a single platform"""
- def __init__(self, platform, text_file):
- self._text_file = text_file
- TestOutput.__init__(self, platform, 'text', [text_file])
-
- def same_content(self, other):
- return self._text_file.contents() == other._text_file.contents()
-
- def retarget(self, platform):
- return TextTestOutput(platform, self._text_file)
-
-
-class ImageTestOutput(TestOutput):
- image_differ = NaiveImageDiffer()
- """Represents an image output of a single test on a single platform"""
- def __init__(self, platform, image_file, checksum_file):
- self._checksum_file = checksum_file
- self._image_file = image_file
- files = filter(bool, [self._checksum_file, self._image_file])
- TestOutput.__init__(self, platform, 'image', files)
-
- def has_checksum(self):
- return self._checksum_file is not None
-
- def same_content(self, other):
- # FIXME This should not assume that checksums are up to date.
- if self.has_checksum() and other.has_checksum():
- return self._checksum_file.contents() == other._checksum_file.contents()
- else:
- self_contents = self._image_file.contents()
- other_contents = other._image_file.contents()
- return ImageTestOutput.image_differ.same_image(self_contents, other_contents)
-
- def retarget(self, platform):
- return ImageTestOutput(platform, self._image_file, self._checksum_file)
-
- def checksum(self):
- return self._checksum_file.contents()
Deleted: trunk/Tools/Scripts/webkitpy/common/net/testoutput_unittest.py (92562 => 92563)
--- trunk/Tools/Scripts/webkitpy/common/net/testoutput_unittest.py 2011-08-06 22:17:24 UTC (rev 92562)
+++ trunk/Tools/Scripts/webkitpy/common/net/testoutput_unittest.py 2011-08-06 22:19:39 UTC (rev 92563)
@@ -1,144 +0,0 @@
-#!/usr/bin/env python
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import re
-import sys
-import testoutput
-import unittest
-
-
-class FakeFile(object):
- def __init__(self, filename, contents="fake contents"):
- self._filename = filename
- self._contents = contents
-
- def name(self):
- return self._filename
-
- def contents(self):
- return self._contents
-
-
-class FakeTestOutput(testoutput.TestOutput):
- def __init__(self, platform, output_type, contents, is_expected=False):
- self._output_type = output_type
- self._contents = contents
- self._is_expected = is_expected
- actual = 'actual'
- if is_expected:
- actual = 'expected'
- test_name = 'anonymous-test-%s.txt' % actual
- file = FakeFile(test_name, contents)
- super(FakeTestOutput, self).__init__(platform, output_type, [file])
-
- def contents(self):
- return self._contents
-
- def retarget(self, platform):
- return FakeTestOutput(platform, self._output_type, self._contents, self._is_expected)
-
-
-class TestOutputTest(unittest.TestCase):
- def _check_name(self, filename, expected_test_name):
- # FIXME: should consider using MockFileSystem here so as to not
- # have to worry about platform-specific path separators.
- if sys.platform == 'win32':
- filename = filename.replace('/', os.path.sep)
- expected_test_name = expected_test_name.replace('/', os.path.sep)
- r = testoutput.TextTestOutput(None, FakeFile(filename))
- self.assertEquals(expected_test_name, r.name())
-
- def _check_platform(self, filename, expected_platform):
- # FIXME: should consider using MockFileSystem here so as to not
- # have to worry about platform-specific path separators.
- if sys.platform == 'win32':
- filename = filename.replace('/', os.path.sep)
- r = testoutput.TextTestOutput(None, FakeFile(filename))
- self.assertEquals(expected_platform, r.platform())
-
- def test_extracts_name_correctly(self):
- self._check_name('LayoutTests/fast/dom/a-expected.txt', 'fast/dom/a')
- self._check_name('LayoutTests/fast/dom/a-actual.txt', 'fast/dom/a')
- self._check_name('LayoutTests/platform/win/fast/a-expected.txt', 'fast/a')
- self._check_name('LayoutTests/platform/win/fast/a-expected.checksum', 'fast/a')
- self._check_name('fast/dom/test-expected.txt', 'fast/dom/test')
- self._check_name('layout-test-results/fast/a-actual.checksum', 'fast/a')
-
- def test_extracts_platform_correctly(self):
- self._check_platform('LayoutTests/platform/win/fast/a-expected.txt', 'win')
- self._check_platform('platform/win/fast/a-expected.txt', 'win')
- self._check_platform('platform/mac/fast/a-expected.txt', 'mac')
- self._check_platform('fast/a-expected.txt', None)
-
- def test_outputs_from_an_actual_file_are_marked_as_such(self):
- r = testoutput.TextTestOutput(None, FakeFile('test-actual.txt'))
- self.assertTrue(r.is_actual())
-
- def test_outputs_from_an_expected_file_are_not_actual(self):
- r = testoutput.TextTestOutput(None, FakeFile('test-expected.txt'))
- self.assertFalse(r.is_actual())
-
- def test_is_new_baseline_for(self):
- expected = testoutput.TextTestOutput('mac', FakeFile('test-expected.txt'))
- actual = testoutput.TextTestOutput('mac', FakeFile('test-actual.txt'))
- self.assertTrue(actual.is_new_baseline_for(expected))
- self.assertFalse(expected.is_new_baseline_for(actual))
-
- def test__eq__(self):
- r1 = testoutput.TextTestOutput('mac', FakeFile('test-expected.txt', 'contents'))
- r2 = testoutput.TextTestOutput('mac', FakeFile('test-expected.txt', 'contents'))
- r3 = testoutput.TextTestOutput('win', FakeFile('test-expected.txt', 'contents'))
-
- self.assertEquals(r1, r2)
- self.assertEquals(r1, r2.retarget('mac'))
- self.assertNotEquals(r1, r2.retarget('win'))
-
- def test__hash__(self):
- r1 = testoutput.TextTestOutput('mac', FakeFile('test-expected.txt', 'contents'))
- r2 = testoutput.TextTestOutput('mac', FakeFile('test-expected.txt', 'contents'))
- r3 = testoutput.TextTestOutput(None, FakeFile('test-expected.txt', None))
-
- x = set([r1, r2])
- self.assertEquals(1, len(set([r1, r2])))
- self.assertEquals(2, len(set([r1, r2, r3])))
-
- def test_image_diff_is_invoked_for_image_outputs_without_checksum(self):
- r1 = testoutput.ImageTestOutput('mac', FakeFile('test-expected.png', 'asdf'), FakeFile('test-expected.checksum', 'check'))
- r2 = testoutput.ImageTestOutput('mac', FakeFile('test-expected.png', 'asdf'), None)
-
- # Default behaviour is to just compare on image contents.
- self.assertTrue(r1.same_content(r2))
-
- class AllImagesAreDifferent(object):
- def same_image(self, image1, image2):
- return False
-
- # But we can install other image differs.
- testoutput.ImageTestOutput.image_differ = AllImagesAreDifferent()
-
- self.assertFalse(r1.same_content(r2))
-
-if __name__ == "__main__":
- unittest.main()
Deleted: trunk/Tools/Scripts/webkitpy/common/net/testoutputset.py (92562 => 92563)
--- trunk/Tools/Scripts/webkitpy/common/net/testoutputset.py 2011-08-06 22:17:24 UTC (rev 92562)
+++ trunk/Tools/Scripts/webkitpy/common/net/testoutputset.py 2011-08-06 22:19:39 UTC (rev 92563)
@@ -1,130 +0,0 @@
-#!/usr/bin/env python
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-from webkitpy.common.system.directoryfileset import DirectoryFileSet
-from webkitpy.common.system.zipfileset import ZipFileSet
-import re
-import testoutput
-import urllib
-
-
-class TestOutputSet(object):
- def __init__(self, name, platform, zip_file, **kwargs):
- self._name = name
- self._platform = platform
- self._zip_file = zip_file
- self._include_expected = kwargs.get('include_expected', True)
-
- @classmethod
- def from_zip_url(cls, platform, zip_path):
- return TestOutputSet('local zip %s builder' % platform, platform, ZipFileSet(zip_path))
-
- @classmethod
- def from_zip(cls, platform, zip):
- return TestOutputSet('local zip %s builder' % platform, platform, zip)
-
- @classmethod
- def from_zip_map(cls, zip_map):
- output_sets = []
- for k, v in zip_map.items():
- output_sets.append(TestOutputSet.from_zip(k, v))
- return AggregateTestOutputSet(output_sets)
-
- @classmethod
- def from_path(self, path, platform=None):
- return TestOutputSet('local %s builder' % platform, platform, DirectoryFileSet(path))
-
- def name(self):
- return self._name
-
- def set_platform(self, platform):
- self._platform = platform
-
- def files(self):
- return [self._zip_file.open(filename) for filename in self._zip_file.namelist()]
-
- def _extract_output_files(self, name, exact_match):
- name_matcher = re.compile(name)
- actual_matcher = re.compile(r'-actual\.')
- expected_matcher = re.compile(r'-expected\.')
-
- checksum_files = []
- text_files = []
- image_files = []
- for output_file in self.files():
- name_match = name_matcher.search(output_file.name())
- actual_match = actual_matcher.search(output_file.name())
- expected_match = expected_matcher.search(output_file.name())
- if not (name_match and (actual_match or (self._include_expected and expected_match))):
- continue
- if output_file.name().endswith('.checksum'):
- checksum_files.append(output_file)
- elif output_file.name().endswith('.txt'):
- text_files.append(output_file)
- elif output_file.name().endswith('.png'):
- image_files.append(output_file)
-
- return (checksum_files, text_files, image_files)
-
- def _extract_file_with_name(self, name, files):
- for file in files:
- if file.name() == name:
- return file
- return None
-
- def _make_output_from_image(self, image_file, checksum_files):
- checksum_file_name = re.sub('\.png', '.checksum', image_file.name())
- checksum_file = self._extract_file_with_name(checksum_file_name, checksum_files)
- return testoutput.ImageTestOutput(self._platform, image_file, checksum_file)
-
- def outputs_for(self, name, **kwargs):
- target_type = kwargs.get('target_type', None)
- exact_match = kwargs.get('exact_match', False)
- if re.search(r'\.x?html', name):
- name = name[:name.rindex('.')]
-
- (checksum_files, text_files, image_files) = self._extract_output_files(name, exact_match)
-
- outputs = [self._make_output_from_image(image_file, checksum_files) for image_file in image_files]
-
- outputs += [testoutput.TextTestOutput(self._platform, text_file) for text_file in text_files]
-
- if exact_match:
- outputs = filter(lambda output: output.name() == name, outputs)
-
- outputs = filter(lambda r: target_type in [None, r.type()], outputs)
-
- return outputs
-
-
-class AggregateTestOutputSet(object):
- """Set of test outputs from a list of builders"""
- def __init__(self, builders):
- self._builders = builders
-
- def outputs_for(self, name, **kwargs):
- return sum([builder.outputs_for(name, **kwargs) for builder in self._builders], [])
-
- def builders(self):
- return self._builders
Deleted: trunk/Tools/Scripts/webkitpy/common/net/testoutputset_unittest.py (92562 => 92563)
--- trunk/Tools/Scripts/webkitpy/common/net/testoutputset_unittest.py 2011-08-06 22:17:24 UTC (rev 92562)
+++ trunk/Tools/Scripts/webkitpy/common/net/testoutputset_unittest.py 2011-08-06 22:19:39 UTC (rev 92563)
@@ -1,132 +0,0 @@
-#!/usr/bin/env python
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import sys
-
-from webkitpy.common.system.zip_mock import MockZip
-import testoutputset
-import unittest
-
-
-class TestOutputSetTest(unittest.TestCase):
- def _outputset_with_zip(self, zip, **kwargs):
- return testoutputset.TestOutputSet('<fake-outputset>', '<fake-platform>', zip, **kwargs)
-
- def test_text_files_get_interpreted_as_text_outputs(self):
- zip = MockZip()
- zip.insert('fast/dom/some-test-actual.txt', 'actual outputs')
- b = self._outputset_with_zip(zip)
- self.assertEquals(1, len(b.outputs_for('fast/dom/some-test')))
- self.assertEquals('fast/dom/some-test', b.outputs_for('fast/dom/some-test.html')[0].name())
-
- def test_image_and_checksum_files_get_interpreted_as_a_single_image_output(self):
- zip = MockZip()
- zip.insert('fast/dom/some-test-actual.checksum', 'abc123')
- zip.insert('fast/dom/some-test-actual.png', '<image data>')
- b = self._outputset_with_zip(zip)
- outputs = b.outputs_for('fast/dom/some-test')
- self.assertEquals(1, len(outputs))
- output = outputs[0]
- self.assertEquals('image', output.type())
- self.assertEquals('abc123', output.checksum())
-
- def test_multiple_image_outputs_are_detected(self):
- zip = MockZip()
- zip.insert('platform/win/fast/dom/some-test-actual.checksum', 'checksum1')
- zip.insert('platform/win/fast/dom/some-test-actual.png', '<image data 1>')
- zip.insert('platform/mac/fast/dom/some-test-actual.checksum', 'checksum2')
- zip.insert('platform/mac/fast/dom/some-test-actual.png', '<image data 2>')
- b = self._outputset_with_zip(zip)
- outputs = b.outputs_for('fast/dom/some-test')
- self.assertEquals(2, len(outputs))
- self.assertFalse(outputs[0].same_content(outputs[1]))
-
- def test_aggregate_output_set_correctly_retrieves_tests_from_multiple_output_sets(self):
- outputset1_zip = MockZip()
- outputset1_zip.insert('fast/dom/test-actual.txt', 'linux text output')
- outputset1 = testoutputset.TestOutputSet('linux-outputset', 'linux', outputset1_zip)
- outputset2_zip = MockZip()
- outputset2_zip.insert('fast/dom/test-actual.txt', 'windows text output')
- outputset2 = testoutputset.TestOutputSet('win-outputset', 'win', outputset2_zip)
-
- b = testoutputset.AggregateTestOutputSet([outputset1, outputset2])
- self.assertEquals(2, len(b.outputs_for('fast/dom/test')))
-
- def test_can_infer_platform_from_path_if_none_provided(self):
- # FIXME: unclear what the right behavior on win32 is.
- # https://bugs.webkit.org/show_bug.cgi?id=54525.
- if sys.platform == 'win32':
- return
-
- zip = MockZip()
- zip.insert('platform/win/some-test-expected.png', '<image data>')
- zip.insert('platform/win/some-test-expected.checksum', 'abc123')
- b = testoutputset.TestOutputSet('local LayoutTests outputset', None, zip)
-
- outputs = b.outputs_for('some-test')
- self.assertEquals(1, len(outputs))
- self.assertEquals('win', outputs[0].platform())
-
- def test_test_extension_is_ignored(self):
- zip = MockZip()
- zip.insert('test/test-a-actual.txt', 'actual outputs')
- b = self._outputset_with_zip(zip)
- outputs = b.outputs_for('test/test-a.html')
- self.assertEquals(1, len(outputs))
- self.assertEquals('test/test-a', outputs[0].name())
-
- def test_existing_outputs_are_marked_as_such(self):
- zip = MockZip()
- zip.insert('test/test-a-expected.txt', 'expected outputs')
- b = self._outputset_with_zip(zip)
- outputs = b.outputs_for('test/test-a.html')
- self.assertEquals(1, len(outputs))
- self.assertFalse(outputs[0].is_actual())
-
- def test_only_returns_outputs_of_specified_type(self):
- zip = MockZip()
- zip.insert('test/test-a-expected.txt', 'expected outputs')
- zip.insert('test/test-a-expected.checksum', 'expected outputs')
- zip.insert('test/test-a-expected.png', 'expected outputs')
- b = self._outputset_with_zip(zip)
-
- outputs = b.outputs_for('test/test-a.html')
- text_outputs = b.outputs_for('test/test-a.html', target_type='text')
- image_outputs = b.outputs_for('test/test-a.html', target_type='image')
-
- self.assertEquals(2, len(outputs))
- self.assertEquals(1, len(text_outputs))
- self.assertEquals(1, len(image_outputs))
- self.assertEquals('text', text_outputs[0].type())
- self.assertEquals('image', image_outputs[0].type())
-
- def test_exclude_expected_outputs_works(self):
- zip = MockZip()
- zip.insert('test-expected.txt', 'expected outputs stored on server for some reason')
- b = self._outputset_with_zip(zip, include_expected=False)
- outputs = b.outputs_for('test', target_type=None)
- self.assertEquals(0, len(outputs))
-
-if __name__ == "__main__":
- unittest.main()
Deleted: trunk/Tools/Scripts/webkitpy/common/system/directoryfileset.py (92562 => 92563)
--- trunk/Tools/Scripts/webkitpy/common/system/directoryfileset.py 2011-08-06 22:17:24 UTC (rev 92562)
+++ trunk/Tools/Scripts/webkitpy/common/system/directoryfileset.py 2011-08-06 22:19:39 UTC (rev 92563)
@@ -1,71 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-from webkitpy.common.system.fileset import FileSetFileHandle
-from webkitpy.common.system.filesystem import FileSystem
-
-
-class DirectoryFileSet(object):
- """The set of files under a local directory."""
- def __init__(self, path, filesystem=None):
- self._path = path
- self._filesystem = filesystem or FileSystem()
- if not self._path.endswith(self._filesystem.sep):
- self._path += self._filesystem.sep
-
- def _full_path(self, filename):
- assert self._is_under(self._path, filename)
- return self._filesystem.join(self._path, filename)
-
- def _drop_directory_prefix(self, path):
- return path[len(self._path):]
-
- def _files_in_directory(self):
- """Returns a list of all the files in the directory, including the path
- to the directory"""
- return self._filesystem.files_under(self._path)
-
- def _is_under(self, dir, filename):
- return bool(self._filesystem.relpath(self._filesystem.join(dir, filename), dir))
-
- def open(self, filename):
- return FileSetFileHandle(self, filename, self._filesystem)
-
- def namelist(self):
- return map(self._drop_directory_prefix, self._files_in_directory())
-
- def read(self, filename):
- return self._filesystem.read_text_file(self._full_path(filename))
-
- def extract(self, filename, path):
- """Extracts a file from this file set to the specified directory."""
- src = ""
- dest = self._filesystem.join(path, filename)
- # As filename may have slashes in it, we must ensure that the same
- # directory hierarchy exists at the output path.
- self._filesystem.maybe_make_directory(self._filesystem.dirname(dest))
- self._filesystem.copyfile(src, dest)
-
- def delete(self, filename):
- filename = self._full_path(filename)
- self._filesystem.remove(filename)
Deleted: trunk/Tools/Scripts/webkitpy/common/system/directoryfileset_unittest.py (92562 => 92563)
--- trunk/Tools/Scripts/webkitpy/common/system/directoryfileset_unittest.py 2011-08-06 22:17:24 UTC (rev 92562)
+++ trunk/Tools/Scripts/webkitpy/common/system/directoryfileset_unittest.py 2011-08-06 22:19:39 UTC (rev 92563)
@@ -1,70 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-from __future__ import with_statement
-
-import unittest
-
-from webkitpy.common.system.directoryfileset import DirectoryFileSet
-from webkitpy.common.system.filesystem_mock import MockFileSystem
-
-
-class DirectoryFileSetTest(unittest.TestCase):
- def setUp(self):
- files = {}
- files['/test/some-file'] = 'contents'
- files['/test/some-other-file'] = 'other contents'
- files['/test/b/c'] = 'c'
- self._filesystem = MockFileSystem(files)
- self._fileset = DirectoryFileSet('/test', self._filesystem)
-
- def test_files_in_namelist(self):
- self.assertTrue('some-file' in self._fileset.namelist())
- self.assertTrue('some-other-file' in self._fileset.namelist())
- self.assertTrue('b/c' in self._fileset.namelist())
-
- def test_read(self):
- self.assertEquals('contents', self._fileset.read('some-file'))
-
- def test_open(self):
- file = self._fileset.open('some-file')
- self.assertEquals('some-file', file.name())
- self.assertEquals('contents', file.contents())
-
- def test_extract(self):
- self._fileset.extract('some-file', '/test-directory')
- contents = self._filesystem.read_text_file('/test-directory/some-file')
- self.assertEquals('contents', contents)
-
- def test_extract_deep_file(self):
- self._fileset.extract('b/c', '/test-directory')
- self.assertTrue(self._filesystem.exists('/test-directory/b/c'))
-
- def test_delete(self):
- self.assertTrue(self._filesystem.exists('/test/some-file'))
- self._fileset.delete('some-file')
- self.assertFalse(self._filesystem.exists('/test/some-file'))
-
-
-if __name__ == '__main__':
- unittest.main()
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py (92562 => 92563)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2011-08-06 22:17:24 UTC (rev 92562)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2011-08-06 22:19:39 UTC (rev 92563)
@@ -39,7 +39,6 @@
from webkitpy.common.checkout.scm import detect_scm_system
from webkitpy.common.memoized import memoized
-from webkitpy.common.net.testoutputset import AggregateTestOutputSet
# Handle Python < 2.6 where multiprocessing isn't available.
@@ -587,14 +586,6 @@
expectations, determining search paths, and logging information."""
return self._version
- def _results_for_platform(self, platform):
- """Returns a TestOutputSet for the bots of the given platform."""
- raise NotImplementedError('Port._results_for_platform')
-
- def buildbot_test_output_set(self, platforms):
- """Returns a TestOutputSet for the specified platforms for this ports buildbots."""
- return AggregateTestOutputSet([self._results_for_platform(platform) for platform in platforms])
-
def graphics_type(self):
"""Returns whether the port uses accelerated graphics ('gpu') or not ('cpu')."""
return self._graphics_type
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py (92562 => 92563)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py 2011-08-06 22:17:24 UTC (rev 92562)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py 2011-08-06 22:19:39 UTC (rev 92563)
@@ -40,10 +40,8 @@
import webbrowser
from webkitpy.common.config import urls
-from webkitpy.common.net.testoutputset import TestOutputSet
from webkitpy.common.system import executive
from webkitpy.common.system.path import cygpath
-from webkitpy.common.system.zipfileset import ZipFileSet
from webkitpy.layout_tests.models import test_expectations
from webkitpy.layout_tests.models.test_configuration import TestConfiguration
from webkitpy.layout_tests.port.base import Port
@@ -225,14 +223,6 @@
return self.path_from_webkit_base('LayoutTests', 'platform',
'chromium', 'test_expectations.txt')
- def _results_for_platform(self, platform):
- builder_name = builders.builder_path_for_port_name(platform)
- if not builder_name:
- raise Exception("Can't find builder for %s" % platform)
- zip_url = urls.chromium_results_zip_url(builder_name)
- return TestOutputSet(builder_name, platform, ZipFileSet(zip_url),
- include_expected=False)
-
def default_results_directory(self):
try:
return self.path_from_chromium_base('webkit',
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py (92562 => 92563)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py 2011-08-06 22:17:24 UTC (rev 92562)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py 2011-08-06 22:19:39 UTC (rev 92563)
@@ -80,16 +80,6 @@
expectations_directory = self._wk2_port_name() if self.get_option('webkit_test_runner') else self.port_name
return self._filesystem.join(self._webkit_baseline_path(expectations_directory), 'test_expectations.txt')
- def _results_for_platform(self, platform):
- builder_name = builders.builder_path_for_port_name(platform)
- if not builder_name:
- raise Exception("Can't find builder for %s" % platform)
- builders_by_name = dict([(builder.name(), builder) for builder in BuildBot().builders()])
- builder = builders_by_name[builder_name]
- result_set = builder.latest_cached_build().results()
- result_set.set_platform(platform)
- return result_set
-
def _driver_build_script_name(self):
if self.get_option('webkit_test_runner'):
return "build-webkittestrunner"