[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

dpranke at chromium.org dpranke at chromium.org
Thu Apr 8 02:05:12 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 06b44e45019f167452935da9d61ab92e310d8b2c
Author: dpranke at chromium.org <dpranke at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Mar 1 20:41:29 2010 +0000

    2010-03-01  Dirk Pranke  <dpranke at chromium.org>
    
            Reviewed by David Levin.
    
            General cleanup of error handling in new-run-webkit-tests.
    
            Add Port.check_build() call that is separate from Port.check_sys_deps()
            (and add a --nocheck-build flag to skip). This breaks a circular
            dependency where you would start the layout test helper before
            checking sys deps, but checking sys deps was the thing that told
            you if your binaries where there.
    
            Also, made Port.check_sys_deps(), start_helper() and stop_helper()
            optional by providing default implementations in the base class
            rather than requiring ports to implement the routines regardless
            of whether or not they were needed.
    
            Lastly, tweak a bunch of log messages to be cleaner, including
            changing messages in thirdparty/autoinstall.py to be silent at
            the default log level.
    
            http://bugs.webkit.org/show_bug.cgi?id=35416
    
            * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
            * Scripts/webkitpy/layout_tests/port/base.py:
            * Scripts/webkitpy/layout_tests/port/chromium.py:
            * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
            * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
            * Scripts/webkitpy/layout_tests/port/chromium_win.py:
            * Scripts/webkitpy/layout_tests/port/mac.py:
            * Scripts/webkitpy/layout_tests/port/passing.py:
            * Scripts/webkitpy/layout_tests/port/test.py:
            * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
            * Scripts/webkitpy/thirdparty/autoinstall.py
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55373 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index eec94f4..164a68b 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,38 @@
+2010-03-01  Dirk Pranke  <dpranke at chromium.org>
+
+        Reviewed by David Levin.
+
+        General cleanup of error handling in new-run-webkit-tests.
+
+        Add Port.check_build() call that is separate from Port.check_sys_deps()
+        (and add a --nocheck-build flag to skip). This breaks a circular
+        dependency where you would start the layout test helper before
+        checking sys deps, but checking sys deps was the thing that told
+        you if your binaries where there.
+
+        Also, made Port.check_sys_deps(), start_helper() and stop_helper()
+        optional by providing default implementations in the base class
+        rather than requiring ports to implement the routines regardless
+        of whether or not they were needed.
+
+        Lastly, tweak a bunch of log messages to be cleaner, including
+        changing messages in thirdparty/autoinstall.py to be silent at
+        the default log level.
+
+        http://bugs.webkit.org/show_bug.cgi?id=35416
+
+        * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/port/passing.py:
+        * Scripts/webkitpy/layout_tests/port/test.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+        * Scripts/webkitpy/thirdparty/autoinstall.py
+
 2010-03-01  Dirk Pranke <dpranke at chromium.org>
 
          Reviewed by David Levin.
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
index 01add62..cdf4071 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
@@ -633,11 +633,13 @@ class TestExpectationsFile:
                 build_type = 'DEBUG'
             else:
                 build_type = 'RELEASE'
-            print "\nFAILURES FOR PLATFORM: %s, BUILD_TYPE: %s" \
-                % (self._test_platform_name.upper(), build_type)
+            logging.error('')
+            logging.error("FAILURES FOR PLATFORM: %s, BUILD_TYPE: %s" %
+                          (self._test_platform_name.upper(), build_type))
 
             for error in self._non_fatal_errors:
                 logging.error(error)
+            logging.error('')
             if len(self._errors):
                 raise SyntaxError('\n'.join(map(str, self._errors)))
 
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
index d08863d..0c73182 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
@@ -68,12 +68,18 @@ class Port(object):
         baselines. The directories are searched in order."""
         raise NotImplementedError('Port.baseline_search_path')
 
+    def check_build(self, needs_http):
+        """This routine is used to ensure that the build is up to date
+        and all the needed binaries are present."""
+        raise NotImplementedError('Port.check_build')
+
     def check_sys_deps(self, needs_http):
         """If the port needs to do some runtime checks to ensure that the
-        tests can be run successfully, they should be done here.
+        tests can be run successfully, it should override this routine.
+        This step can be skipped with --nocheck-sys-deps.
 
         Returns whether the system is properly configured."""
-        raise NotImplementedError('Port.check_sys_deps')
+        return True
 
     def compare_text(self, expected_text, actual_text):
         """Return whether or not the two strings are *not* equal. This
@@ -381,10 +387,10 @@ class Port(object):
         raise NotImplementedError('Port.start_driver')
 
     def start_helper(self):
-        """Start a layout test helper if needed on this port. The test helper
-        is used to reconfigure graphics settings and do other things that
-        may be necessary to ensure a known test configuration."""
-        raise NotImplementedError('Port.start_helper')
+        """If a port needs to reconfigure graphics settings or do other
+        things to ensure a known test configuration, it should override this
+        method."""
+        pass
 
     def start_http_server(self):
         """Start a web server if it is available. Do nothing if
@@ -408,8 +414,9 @@ class Port(object):
 
     def stop_helper(self):
         """Shut down the test helper if it is running. Do nothing if
-        it isn't, or it isn't available."""
-        raise NotImplementedError('Port.stop_helper')
+        it isn't, or it isn't available. If a port overrides start_helper()
+        it must override this routine as well."""
+        pass
 
     def stop_http_server(self):
         """Shut down the http server if it is running. Do nothing if
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
index 25adcd7..e06a255 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
@@ -42,10 +42,19 @@ import http_server
 import websocket_server
 
 
-def check_file_exists(path_to_file, str):
-    """Verify the executable is present where expected or log an error."""
+def check_file_exists(path_to_file, file_description, override_step=None):
+    """Verify the file is present where expected or log an error.
+
+    Args:
+        file_name: The (human friendly) name or description of the file
+            you're looking for (e.g., "HTTP Server"). Used for error logging.
+        override_step: An optional string to be logged if the check fails."""
     if not os.path.exists(path_to_file):
-        logging.error('Unable to find %s at %s' % (str, path_to_file))
+        logging.error('Unable to find %s' % file_description)
+        logging.error('    at %s' % path_to_file)
+        if override_step:
+            logging.error('    %s' % override_step)
+            logging.error('')
         return False
     return True
 
@@ -60,36 +69,38 @@ class ChromiumPort(base.Port):
     def baseline_path(self):
         return self._chromium_baseline_path(self._name)
 
-    def check_sys_deps(self, needs_http):
+    def check_build(self, needs_http):
         result = True
         test_shell_binary_path = self._path_to_driver()
         result = check_file_exists(test_shell_binary_path,
                                    'test driver')
         if result:
-            result = (self._check_build_up_to_date(self._options.target)
+            result = (self._check_driver_build_up_to_date(self._options.target)
                       and result)
-
-            proc = subprocess.Popen([test_shell_binary_path,
-                                     '--check-layout-test-sys-deps'])
-            if proc.wait() != 0:
-                logging.error('System dependencies check failed.')
-                logging.error('To override, invoke with --nocheck-sys-deps')
-                logging.error('')
-                result = False
-
         else:
             logging.error('')
 
+        helper_path = self._path_to_helper()
+        result = check_file_exists(helper_path,
+                                   'layout test helper') and result
 
         if not self._options.no_pixel_tests:
             image_diff_path = self._path_to_image_diff()
-            if not check_file_exists(image_diff_path, 'image diff exe'):
-                logging.error('To override, invoke with --no-pixel-tests')
-                logging.error('')
-                result = False
+            result = check_file_exists(image_diff_path, 'image diff exe',
+                'To override, invoke with --no-pixel-tests') and result
 
         return result
 
+    def check_sys_deps(self, needs_http):
+        proc = subprocess.Popen([test_shell_binary_path,
+                                '--check-layout-test-sys-deps'])
+        if proc.wait():
+            logging.error('System dependencies check failed.')
+            logging.error('To override, invoke with --nocheck-sys-deps')
+            logging.error('')
+            result = False
+        return True
+
     def path_from_chromium_base(self, *comps):
         """Returns the full path to path made by joining the top of the
         Chromium source tree and the list of path components in |*comps|."""
@@ -161,7 +172,7 @@ class ChromiumPort(base.Port):
     # or any subclasses.
     #
 
-    def _check_build_up_to_date(self, target):
+    def _check_driver_build_up_to_date(self, target):
         if target in ('Debug', 'Release'):
             try:
                 debug_path = self._path_to_driver('Debug')
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
index 7495572..53df348 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
@@ -54,8 +54,8 @@ class ChromiumLinuxPort(chromium.ChromiumPort):
                 self._webkit_baseline_path('win'),
                 self._webkit_baseline_path('mac')]
 
-    def check_sys_deps(self, needs_http):
-        result = chromium.ChromiumPort.check_sys_deps(self, needs_http)
+    def check_build(self, needs_http):
+        result = chromium.ChromiumPort.check_build(self, needs_http)
         if needs_http:
             if self._options.use_apache:
                 result = self._check_apache_install() and result
@@ -101,7 +101,7 @@ class ChromiumLinuxPort(chromium.ChromiumPort):
         result = chromium.check_file_exists(self._path_to_apache_config_file(),
             "apache2 config file") and result
         if not result:
-            logging.error('Please install using: "sudo apt-get install '
+            logging.error('    Please install using: "sudo apt-get install '
                           'apache2 libapache2-mod-php5"')
             logging.error('')
         return result
@@ -114,7 +114,7 @@ class ChromiumLinuxPort(chromium.ChromiumPort):
         result = chromium.check_file_exists(self._path_to_lighttpd_modules(),
             "LigHTTPd modules") and result
         if not result:
-            logging.error('Please install using: "sudo apt-get install '
+            logging.error('    Please install using: "sudo apt-get install '
                           'lighttpd php5-cgi"')
             logging.error('')
         return result
@@ -122,7 +122,7 @@ class ChromiumLinuxPort(chromium.ChromiumPort):
     def _check_wdiff_install(self):
         result = chromium.check_file_exists(self._path_to_wdiff(), 'wdiff')
         if not result:
-            logging.error('Please install using: "sudo apt-get install '
+            logging.error('    Please install using: "sudo apt-get install '
                           'wdiff"')
             logging.error('')
         return result
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
index ece10b0..1093517 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
@@ -53,8 +53,8 @@ class ChromiumMacPort(chromium.ChromiumPort):
                 self._webkit_baseline_path('mac' + self.version()),
                 self._webkit_baseline_path('mac')]
 
-    def check_sys_deps(self, needs_http):
-        result = chromium.ChromiumPort.check_sys_deps(self, needs_http)
+    def check_build(self, needs_http):
+        result = chromium.ChromiumPort.check_build(self, needs_http)
         result = self._check_wdiff_install() and result
         if not result:
             logging.error('For complete Mac build requirements, please see:')
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
index 25b1a2a..555244c 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
@@ -60,8 +60,8 @@ class ChromiumWinPort(chromium.ChromiumPort):
         dirs.append(self._webkit_baseline_path('mac'))
         return dirs
 
-    def check_sys_deps(self, needs_http):
-        result = chromium.ChromiumPort.check_sys_deps(self, needs_http)
+    def check_build(self, needs_http):
+        result = chromium.ChromiumPort.check_build(self, needs_http)
         if not result:
             logging.error('For complete Windows build requirements, please '
                           'see:')
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
index 9b70cb7..c51a92b 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
@@ -66,8 +66,9 @@ class MacPort(base.Port):
         dirs.append(self._webkit_baseline_path('mac'))
         return dirs
 
-    def check_sys_deps(self, needs_http):
-        if executive.run_command([self.script_path("build-dumprendertree")], return_exit_code=True) != 0:
+    def check_build(self, needs_http):
+        if executive.run_command([self.script_path("build-dumprendertree")],
+                                 return_exit_code=True):
             return False
 
         driver_path = self._path_to_driver()
@@ -75,7 +76,8 @@ class MacPort(base.Port):
             logging.error("DumpRenderTree was not found at %s" % driver_path)
             return False
 
-        # This should also validate that the ImageDiff path is valid (once this script knows how to use ImageDiff).
+        # This should also validate that the ImageDiff path is valid
+        # (once this script knows how to use ImageDiff).
         # https://bugs.webkit.org/show_bug.cgi?id=34826
         return True
 
@@ -98,14 +100,6 @@ class MacPort(base.Port):
         """Starts a new Driver and returns a handle to it."""
         return MacDriver(self, image_path, options)
 
-    def start_helper(self):
-        # This port doesn't use a helper process.
-        pass
-
-    def stop_helper(self):
-        # This port doesn't use a helper process.
-        pass
-
     def test_base_platform_names(self):
         # At the moment we don't use test platform names, but we have
         # to return something.
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/passing.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/passing.py
index 02e205f..2735b4b 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/passing.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/passing.py
@@ -38,8 +38,8 @@
 
    Note that because this is really acting as a wrapper around the underlying
    port, you must be able to run the underlying port as well
-   (check_sys_deps() must pass and the layout_test_helper must work). You
-   may be able to get around this with --nocheck-sys-deps and --nostart-helper.
+   (check_build() and check_sys_deps() must pass and auxiliary binaries
+   like layout_test_helper and httpd must work).
 
    This implementation also modifies the test expectations so that all
    tests are either SKIPPED or expected to PASS."""
@@ -60,7 +60,7 @@ class PassingPort(object):
 
     def __getattr__(self, name):
         return getattr(self.__delegate, name)
- 
+
     def start_driver(self, image_path, options):
         return PassingDriver(self, image_path, options)
 
@@ -98,13 +98,20 @@ class PassingDriver(base.Driver):
 
         if image_hash:
             image_filename = self._port.expected_filename(test_name, '.png')
-            image = file(image_filename, 'rb').read()
-            output_file = file(self._image_path, 'w')
-            output_file.write(image)
-            output_file.close()
+            try:
+                image = file(image_filename, 'rb').read()
+            except IOError:
+                image = ''
+            if self._image_path:
+                output_file = file(self._image_path, 'w')
+                output_file.write(image)
+                output_file.close()
             hash_filename = self._port.expected_filename(test_name,
                 '.checksum')
-            hash = file(hash_filename, 'r').read()
+            try:
+                hash = file(hash_filename, 'r').read()
+            except IOError:
+                hash = ''
         else:
             hash = None
         return (False, False, hash, text_output, None)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
index f959e6e..6f51e1d 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
@@ -52,14 +52,14 @@ class TestPort(base.Port):
     def baseline_search_path(self):
         return [self.baseline_path()]
 
-    def check_sys_deps(self, needs_http):
+    def check_build(self, needs_http):
         return True
 
-    def diff_image(self, expected_filename, actual_filename,
-                   diff_filename=None):
+    def compare_text(self, expected_text, actual_text):
         return False
 
-    def compare_text(self, expected_text, actual_text):
+    def diff_image(self, expected_filename, actual_filename,
+                   diff_filename=None):
         return False
 
     def diff_text(self, expected_text, actual_text,
@@ -93,18 +93,12 @@ class TestPort(base.Port):
     def start_websocket_server(self):
         pass
 
-    def start_helper(self):
-        pass
-
     def stop_http_server(self):
         pass
 
     def stop_websocket_server(self):
         pass
 
-    def stop_helper(self):
-        pass
-
     def test_expectations(self):
         return ''
 
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
index 003b9c3..042e791 100755
--- a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
@@ -552,6 +552,7 @@ class TestRunner:
               in the form {filename:filename, test_run_time:test_run_time}
             result_summary: summary object to populate with the results
         """
+        self._meter.update('Starting test shells ...')
         threads = self._instantiate_test_shell_threads(file_list,
                                                        result_summary)
 
@@ -614,9 +615,11 @@ class TestRunner:
         start_time = time.time()
 
         if self.needs_http():
+            self._meter.update('Starting HTTP server ...')
             self._port.start_http_server()
 
         if self._contains_tests(self.WEBSOCKET_SUBDIR):
+            self._meter.update('Starting WebSocket server ...')
             self._port.start_websocket_server()
             # self._websocket_secure_server.Start()
 
@@ -1468,13 +1471,18 @@ def main(options, args):
     test_runner.parse_expectations(port_obj.test_platform_name(),
                                    options.target == 'Debug')
 
-    if not options.nostart_helper:
-        port_obj.start_helper()
+    meter.update("Checking build ...")
+    if not port_obj.check_build(test_runner.needs_http()):
+        sys.exit(1)
+
+    meter.update("Starting helper ...")
+    port_obj.start_helper()
 
     # Check that the system dependencies (themes, fonts, ...) are correct.
-    if (not options.nocheck_sys_deps and
-         not port_obj.check_sys_deps(test_runner.needs_http())):
-        sys.exit(1)
+    if not options.nocheck_sys_deps:
+        meter.update("Checking system dependencies ...")
+        if not port_obj.check_sys_deps(test_runner.needs_http()):
+            sys.exit(1)
 
     meter.update("Preparing tests ...")
     write = create_logging_writer(options, "expected")
@@ -1488,11 +1496,9 @@ def main(options, args):
         if options.fuzzy_pixel_tests:
             test_runner.add_test_type(fuzzy_image_diff.FuzzyImageDiff)
 
-    meter.update("Starting ...")
     has_new_failures = test_runner.run(result_summary)
 
-    if not options.nostart_helper:
-        port_obj.stop_helper()
+    port_obj.stop_helper()
 
     logging.debug("Exit status: %d" % has_new_failures)
     sys.exit(has_new_failures)
@@ -1621,9 +1627,6 @@ def parse_args(args=None):
     option_parser.add_option("", "--experimental-fully-parallel",
                              action="store_true", default=False,
                              help="run all tests in parallel")
-    option_parser.add_option("", "--nostart-helper",
-                             action="store_true", default=False,
-                             help="don't run layout_test_helper")
     option_parser.add_option("", "--chromium",
                              action="store_true", default=False,
                              help="use the Chromium port")
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/autoinstall.py b/WebKitTools/Scripts/webkitpy/thirdparty/autoinstall.py
index 467e6b4..6c864cf 100644
--- a/WebKitTools/Scripts/webkitpy/thirdparty/autoinstall.py
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/autoinstall.py
@@ -293,7 +293,8 @@ class Importer(object):
         return None
 
     def bind(self, package_name, url, zip_subpath):
-        _logger.info("binding: %s -> %s subpath: %s" % (package_name, url, zip_subpath))
+        _logger.debug("binding: %s -> %s subpath: %s" %
+                      (package_name, url, zip_subpath))
         self.packages[package_name] = (url, zip_subpath)
 
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list