Title: [124378] trunk/Tools
Revision
124378
Author
[email protected]
Date
2012-08-01 15:53:06 -0700 (Wed, 01 Aug 2012)

Log Message

test-webkitpy: clean up handling of tests to skip
https://bugs.webkit.org/show_bug.cgi?id=92909

Reviewed by Ryosuke Niwa.

This change moves the handling of tests to skip into main.py
where it is at least slightly more findable and generic.

Also fix a couple of lint nits.

* Scripts/webkitpy/test/finder.py:
(Finder.__init__):
(Finder.skip):
(Finder._default_names):
* Scripts/webkitpy/test/main.py:
(main):
(Tester.skip):
* Scripts/webkitpy/test/main_unittest.py:
(TesterTest.test_no_tests_found):
* Scripts/webkitpy/test/runner_unittest.py:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (124377 => 124378)


--- trunk/Tools/ChangeLog	2012-08-01 22:52:05 UTC (rev 124377)
+++ trunk/Tools/ChangeLog	2012-08-01 22:53:06 UTC (rev 124378)
@@ -1,5 +1,28 @@
 2012-08-01  Dirk Pranke  <[email protected]>
 
+        test-webkitpy: clean up handling of tests to skip
+        https://bugs.webkit.org/show_bug.cgi?id=92909
+
+        Reviewed by Ryosuke Niwa.
+
+        This change moves the handling of tests to skip into main.py
+        where it is at least slightly more findable and generic.
+
+        Also fix a couple of lint nits.
+
+        * Scripts/webkitpy/test/finder.py:
+        (Finder.__init__):
+        (Finder.skip):
+        (Finder._default_names):
+        * Scripts/webkitpy/test/main.py:
+        (main):
+        (Tester.skip):
+        * Scripts/webkitpy/test/main_unittest.py:
+        (TesterTest.test_no_tests_found):
+        * Scripts/webkitpy/test/runner_unittest.py:
+
+2012-08-01  Dirk Pranke  <[email protected]>
+
         test-webkitpy: remove --skip-integrationtests flag
         https://bugs.webkit.org/show_bug.cgi?id=92907
 

Modified: trunk/Tools/Scripts/webkitpy/test/finder.py (124377 => 124378)


--- trunk/Tools/Scripts/webkitpy/test/finder.py	2012-08-01 22:52:05 UTC (rev 124377)
+++ trunk/Tools/Scripts/webkitpy/test/finder.py	2012-08-01 22:53:06 UTC (rev 124378)
@@ -25,7 +25,6 @@
 
 import logging
 import re
-import sys
 
 
 _log = logging.getLogger(__name__)
@@ -77,10 +76,14 @@
     def __init__(self, filesystem):
         self.filesystem = filesystem
         self.trees = []
+        self._names_to_skip = []
 
     def add_tree(self, top_directory, starting_subdirectory=None):
         self.trees.append(_DirectoryTree(self.filesystem, top_directory, starting_subdirectory))
 
+    def skip(self, names, reason, bugid):
+        self._names_to_skip.append(tuple([names, reason, bugid]))
+
     def additional_paths(self, paths):
         return [tree.top_directory for tree in self.trees if tree.top_directory not in paths]
 
@@ -151,17 +154,10 @@
         for module in modules:
             _log.debug("Found: %s" % module)
 
-        # FIXME: Figure out how to move this to test-webkitpy in order to to make this file more generic.
         if not find_all:
-            slow_tests = ('webkitpy.common.checkout.scm.scm_unittest',)
-            self._exclude(modules, slow_tests, 'are really, really slow', 31818)
+            for (names, reason, bugid) in self._names_to_skip:
+                self._exclude(modules, names, reason, bugid)
 
-            if sys.platform == 'win32':
-                win32_blacklist = ('webkitpy.common.checkout',
-                                   'webkitpy.common.config',
-                                   'webkitpy.tool')
-                self._exclude(modules, win32_blacklist, 'fail horribly on win32', 54526)
-
         return modules
 
     def _exclude(self, modules, module_prefixes, reason, bugid):

Modified: trunk/Tools/Scripts/webkitpy/test/main.py (124377 => 124378)


--- trunk/Tools/Scripts/webkitpy/test/main.py	2012-08-01 22:52:05 UTC (rev 124377)
+++ trunk/Tools/Scripts/webkitpy/test/main.py	2012-08-01 22:53:06 UTC (rev 124378)
@@ -48,7 +48,11 @@
     tester.add_tree(os.path.join(webkit_root, 'Tools', 'Scripts'), 'webkitpy')
     tester.add_tree(os.path.join(webkit_root, 'Source', 'WebKit2', 'Scripts'), 'webkit2')
 
-    # FIXME: Do we need to be able to test QueueStatusServer on Windows as well?
+    tester.skip(('webkitpy.common.checkout.scm.scm_unittest',), 'are really, really, slow', 31818)
+    if sys.platform == 'win32':
+        tester.skip(('webkitpy.common.checkout', 'webkitpy.common.config', 'webkitpy.tool'), 'fail horribly on win32', 54526)
+
+    # This only needs to run on Unix, so don't worry about win32 for now.
     appengine_sdk_path = '/usr/local/google_appengine'
     if os.path.exists(appengine_sdk_path):
         if not appengine_sdk_path in sys.path:
@@ -73,6 +77,9 @@
     def add_tree(self, top_directory, starting_subdirectory=None):
         self.finder.add_tree(top_directory, starting_subdirectory)
 
+    def skip(self, names, reason, bugid):
+        self.finder.skip(names, reason, bugid)
+
     def _parse_args(self):
         parser = optparse.OptionParser(usage='usage: %prog [options] [args...]')
         parser.add_option('-a', '--all', action='', default=False,

Modified: trunk/Tools/Scripts/webkitpy/test/main_unittest.py (124377 => 124378)


--- trunk/Tools/Scripts/webkitpy/test/main_unittest.py	2012-08-01 22:52:05 UTC (rev 124377)
+++ trunk/Tools/Scripts/webkitpy/test/main_unittest.py	2012-08-01 22:53:06 UTC (rev 124378)
@@ -47,7 +47,7 @@
             oc.capture_output()
             self.assertFalse(tester.run())
         finally:
-            out, err, logs = oc.restore_output()
+            _, _, logs = oc.restore_output()
             root_logger.handlers = root_handlers
 
         self.assertTrue('No tests to run' in errors.getvalue())

Modified: trunk/Tools/Scripts/webkitpy/test/runner_unittest.py (124377 => 124378)


--- trunk/Tools/Scripts/webkitpy/test/runner_unittest.py	2012-08-01 22:52:05 UTC (rev 124377)
+++ trunk/Tools/Scripts/webkitpy/test/runner_unittest.py	2012-08-01 22:53:06 UTC (rev 124378)
@@ -27,7 +27,7 @@
 
 from webkitpy.tool.mocktool import MockOptions
 from webkitpy.test.printer import Printer
-from webkitpy.test.runner import Runner, _Worker
+from webkitpy.test.runner import Runner
 
 
 class FakeModuleSuite(object):
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to