[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

dpranke at chromium.org dpranke at chromium.org
Sun Feb 20 23:22:03 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 5af6135e795cbb961077d314248e1a2860e55ec8
Author: dpranke at chromium.org <dpranke at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 20 04:17:09 2011 +0000

    2011-01-19  Dirk Pranke  <dpranke at chromium.org>
    
            Unreviewed, build fix - I pulled this patch in to fix an issue
            revealed by r76195 running on some new bots). Also fix a couple
            of other issues revealed in testing.
    
            nrwt: remove fs refs from layout_package/json*
    
            https://bugs.webkit.org/show_bug.cgi?id=52754
    
            * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
            * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
            * Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py:
            * Scripts/webkitpy/layout_tests/layout_package/test_runner.py:
            * Scripts/webkitpy/layout_tests/port/base.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76200 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index 4ff749e..0492c4d 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,5 +1,21 @@
 2011-01-19  Dirk Pranke  <dpranke at chromium.org>
 
+        Unreviewed, build fix - I pulled this patch in to fix an issue
+        revealed by r76195 running on some new bots). Also fix a couple
+        of other issues revealed in testing.
+
+        nrwt: remove fs refs from layout_package/json*
+
+        https://bugs.webkit.org/show_bug.cgi?id=52754
+
+        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+        * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
+        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py:
+        * Scripts/webkitpy/layout_tests/layout_package/test_runner.py:
+        * Scripts/webkitpy/layout_tests/port/base.py:
+
+2011-01-19  Dirk Pranke  <dpranke at chromium.org>
+
         Unreviewed, build fix.
 
         Fix a couple of minor bugs discovered while bringing up new bots
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
index b054c5b..3267fb7 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
@@ -27,7 +27,6 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 import logging
-import os
 
 from webkitpy.layout_tests.layout_package import json_results_generator
 from webkitpy.layout_tests.layout_package import test_expectations
@@ -66,12 +65,11 @@ class JSONLayoutResultsGenerator(json_results_generator.JSONResultsGeneratorBase
               results.
         """
         super(JSONLayoutResultsGenerator, self).__init__(
-            builder_name, build_name, build_number, results_file_base_path,
+            port, builder_name, build_name, build_number, results_file_base_path,
             builder_base_url, {}, port.test_repository_paths(),
             generate_incremental_results, test_results_server,
             test_type, master_name)
 
-        self._port = port
         self._expectations = expectations
 
         # We want relative paths to LayoutTest root for JSON output.
@@ -181,9 +179,9 @@ class JSONLayoutResultsGenerator(json_results_generator.JSONResultsGeneratorBase
             test, test_name, tests)
 
         # Remove tests that don't exist anymore.
-        full_path = os.path.join(self._port.layout_tests_dir(), test_name)
-        full_path = os.path.normpath(full_path)
-        if not os.path.exists(full_path):
+        full_path = self._fs.join(self._port.layout_tests_dir(), test_name)
+        full_path = self._fs.normpath(full_path)
+        if not self._fs.exists(full_path):
             del tests[test_name]
 
     def _get_failure_summary_entry(self, timeline):
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
index 12e65b2..32ffd71 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
@@ -26,11 +26,7 @@
 # (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 codecs
 import logging
-import os
 import subprocess
 import sys
 import time
@@ -118,7 +114,7 @@ class JSONResultsGeneratorBase(object):
     URL_FOR_TEST_LIST_JSON = \
         "http://%s/testfile?builder=%s&name=%s&testlistjson=1&testtype=%s"
 
-    def __init__(self, builder_name, build_name, build_number,
+    def __init__(self, port, builder_name, build_name, build_number,
         results_file_base_path, builder_base_url,
         test_results_map, svn_repositories=None,
         generate_incremental_results=False,
@@ -129,6 +125,7 @@ class JSONResultsGeneratorBase(object):
         if it is not found locally.
 
         Args
+          port: port-specific wrapper
           builder_name: the builder name (e.g. Webkit).
           build_name: the build name (e.g. webkit-rel).
           build_number: the build number.
@@ -146,14 +143,16 @@ class JSONResultsGeneratorBase(object):
           test_type: test type string (e.g. 'layout-tests').
           master_name: the name of the buildbot master.
         """
+        self._port = port
+        self._fs = port._filesystem
         self._builder_name = builder_name
         self._build_name = build_name
         self._build_number = build_number
         self._builder_base_url = builder_base_url
         self._results_directory = results_file_base_path
-        self._results_file_path = os.path.join(results_file_base_path,
+        self._results_file_path = self._fs.join(results_file_base_path,
             self.RESULTS_FILENAME)
-        self._incremental_results_file_path = os.path.join(
+        self._incremental_results_file_path = self._fs.join(
             results_file_base_path, self.INCREMENTAL_RESULTS_FILENAME)
 
         self._test_results_map = test_results_map
@@ -254,7 +253,7 @@ class JSONResultsGeneratorBase(object):
                  ("testtype", self._test_type),
                  ("master", self._master_name)]
 
-        files = [(file, os.path.join(self._results_directory, file))
+        files = [(file, self._fs.join(self._results_directory, file))
             for file in json_files]
 
         uploader = test_results_uploader.TestResultsUploader(
@@ -273,10 +272,7 @@ class JSONResultsGeneratorBase(object):
         # Specify separators in order to get compact encoding.
         json_data = simplejson.dumps(json, separators=(',', ':'))
         json_string = self.JSON_PREFIX + json_data + self.JSON_SUFFIX
-
-        results_file = codecs.open(file_path, "w", "utf-8")
-        results_file.write(json_string)
-        results_file.close()
+        self._fs.write_text_file(file_path, json_string)
 
     def _get_test_timing(self, test_name):
         """Returns test timing data (elapsed time) in second
@@ -330,7 +326,7 @@ class JSONResultsGeneratorBase(object):
         Args:
           in_directory: The directory where svn is to be run.
         """
-        if os.path.exists(os.path.join(in_directory, '.svn')):
+        if self._fs.exists(self._fs.join(in_directory, '.svn')):
             # Note: Not thread safe: http://bugs.python.org/issue2320
             output = subprocess.Popen(["svn", "info", "--xml"],
                                       cwd=in_directory,
@@ -358,9 +354,8 @@ class JSONResultsGeneratorBase(object):
         old_results = None
         error = None
 
-        if os.path.exists(self._results_file_path) and not for_incremental:
-            with codecs.open(self._results_file_path, "r", "utf-8") as file:
-                old_results = file.read()
+        if self._fs.exists(self._results_file_path) and not for_incremental:
+            old_results = self._fs.read_text_file(self._results_file_path)
         elif self._builder_base_url or for_incremental:
             if for_incremental:
                 if not self._test_results_server:
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py
index dad549a..ce99765 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py
@@ -31,11 +31,11 @@
 import unittest
 import optparse
 import random
-import shutil
-import tempfile
 
+from webkitpy.common.system import filesystem_mock
 from webkitpy.layout_tests.layout_package import json_results_generator
 from webkitpy.layout_tests.layout_package import test_expectations
+from webkitpy.thirdparty.mock import Mock
 
 
 class JSONGeneratorTest(unittest.TestCase):
@@ -83,7 +83,9 @@ class JSONGeneratorTest(unittest.TestCase):
                 failed=(test in failed_tests),
                 elapsed_time=test_timings[test])
 
-        generator = json_results_generator.JSONResultsGeneratorBase(
+        port = Mock()
+        port._filesystem = filesystem_mock.MockFileSystem()
+        generator = json_results_generator.JSONResultsGeneratorBase(port,
             self.builder_name, self.build_name, self.build_number,
             '',
             None,   # don't fetch past json results archive
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py
index 67524d3..6bdbda9 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py
@@ -35,6 +35,8 @@ objects to the TestRunner.  The TestRunner then aggregates the TestFailures to
 create a final report.
 """
 
+from __future__ import with_statement
+
 import errno
 import logging
 import math
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base.py b/Tools/Scripts/webkitpy/layout_tests/port/base.py
index 74c1018..6e5fabc 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/base.py
@@ -117,7 +117,10 @@ class Port(object):
 
         self._pretty_patch_path = self.path_from_webkit_base("Websites",
             "bugs.webkit.org", "PrettyPatch", "prettify.rb")
-        self._pretty_patch_available = True
+        # If we're running on a mocked-out filesystem, this file almost
+        # certainly won't be available, so it's a good test to keep us
+        # from erroring out later.
+        self._pretty_patch_available = self._filesystem.exists(self._pretty_patch_path)
         self.set_option_default('configuration', None)
         if self._options.configuration is None:
             self._options.configuration = self.default_configuration()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list