Title: [124523] trunk/Tools
Revision
124523
Author
[email protected]
Date
2012-08-02 16:09:11 -0700 (Thu, 02 Aug 2012)

Log Message

test-webkitpy can fail on a clean checkout
https://bugs.webkit.org/show_bug.cgi?id=93039

Reviewed by Adam Barth.

Now that we run tests in parallel that can cause the installer
to try and install packages in parallel (even the same package),
and that probably won't work. We fix this by autoinstalling
everything up front (serially).

* Scripts/webkitpy/test/main.py:
(Tester._run_tests):
* Scripts/webkitpy/thirdparty/__init__.py:
(autoinstall_everything):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (124522 => 124523)


--- trunk/Tools/ChangeLog	2012-08-02 23:06:35 UTC (rev 124522)
+++ trunk/Tools/ChangeLog	2012-08-02 23:09:11 UTC (rev 124523)
@@ -1,3 +1,20 @@
+2012-08-02  Dirk Pranke  <[email protected]>
+
+        test-webkitpy can fail on a clean checkout
+        https://bugs.webkit.org/show_bug.cgi?id=93039
+
+        Reviewed by Adam Barth.
+
+        Now that we run tests in parallel that can cause the installer
+        to try and install packages in parallel (even the same package),
+        and that probably won't work. We fix this by autoinstalling
+        everything up front (serially).
+
+        * Scripts/webkitpy/test/main.py:
+        (Tester._run_tests):
+        * Scripts/webkitpy/thirdparty/__init__.py:
+        (autoinstall_everything):
+
 2012-06-15  David Barton  <[email protected]>
 
         MathML: nested square root symbols have varying descenders

Modified: trunk/Tools/Scripts/webkitpy/test/main.py (124522 => 124523)


--- trunk/Tools/Scripts/webkitpy/test/main.py	2012-08-02 23:06:35 UTC (rev 124522)
+++ trunk/Tools/Scripts/webkitpy/test/main.py	2012-08-02 23:09:11 UTC (rev 124523)
@@ -119,18 +119,20 @@
         return self._run_tests(names)
 
     def _run_tests(self, names):
+        # Make sure PYTHONPATH is set up properly.
+        sys.path = self.finder.additional_paths(sys.path) + sys.path
+
+        # We autoinstall everything up so that we can run tests concurrently
+        # and not have to worry about autoinstalling packages concurrently.
+        self.printer.write_update("Checking autoinstalled packages ...")
+        from webkitpy.thirdparty import autoinstall_everything
+        autoinstall_everything()
+
         if self._options.coverage:
-            try:
-                import webkitpy.thirdparty.autoinstalled.coverage as coverage
-            except ImportError:
-                _log.error("Failed to import 'coverage'; can't generate coverage numbers.")
-                return False
+            import webkitpy.thirdparty.autoinstalled.coverage as coverage
             cov = coverage.coverage()
             cov.start()
 
-        # Make sure PYTHONPATH is set up properly.
-        sys.path = self.finder.additional_paths(sys.path) + sys.path
-
         self.printer.write_update("Checking imports ...")
         if not self._check_imports(names):
             return False

Modified: trunk/Tools/Scripts/webkitpy/thirdparty/__init__.py (124522 => 124523)


--- trunk/Tools/Scripts/webkitpy/thirdparty/__init__.py	2012-08-02 23:06:35 UTC (rev 124522)
+++ trunk/Tools/Scripts/webkitpy/thirdparty/__init__.py	2012-08-02 23:09:11 UTC (rev 124523)
@@ -70,6 +70,8 @@
         if '.autoinstalled' not in fullname:
             return
 
+        # Note: all of the methods must follow the "_install_XXX" convention in
+        # order for autoinstall_everything(), below, to work properly.
         if '.mechanize' in fullname:
             self._install_mechanize()
         elif '.pep8' in fullname:
@@ -155,4 +157,11 @@
         installer.install(url="" url_subpath=url_subpath)
 
 
-sys.meta_path.append(AutoinstallImportHook())
+_hook = AutoinstallImportHook()
+sys.meta_path.append(_hook)
+
+
+def autoinstall_everything():
+    install_methods = [method for method in dir(_hook.__class__) if method.startswith('_install_')]
+    for method in install_methods:
+        getattr(_hook, method)()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to