Title: [90528] trunk/Tools
Revision
90528
Author
[email protected]
Date
2011-07-06 20:18:51 -0700 (Wed, 06 Jul 2011)

Log Message

2011-07-06  Dirk Pranke  <[email protected]>

        nrwt: fix typo preventing http startup on windows
        https://bugs.webkit.org/show_bug.cgi?id=64050

        Reviewed by Eric Siedel.

        NRWT checks whether it needs to start the servers by looking
        for "/http/" in the test names. After r90520, the leading slash
        is not present, so the check isn't quite right.

        * Scripts/webkitpy/layout_tests/controllers/manager.py:
        * Scripts/webkitpy/layout_tests/controllers/manager_unittest.py:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (90527 => 90528)


--- trunk/Tools/ChangeLog	2011-07-07 02:49:47 UTC (rev 90527)
+++ trunk/Tools/ChangeLog	2011-07-07 03:18:51 UTC (rev 90528)
@@ -1,5 +1,19 @@
 2011-07-06  Dirk Pranke  <[email protected]>
 
+        nrwt: fix typo preventing http startup on windows
+        https://bugs.webkit.org/show_bug.cgi?id=64050
+
+        Reviewed by Eric Siedel.
+
+        NRWT checks whether it needs to start the servers by looking
+        for "/http/" in the test names. After r90520, the leading slash
+        is not present, so the check isn't quite right.
+
+        * Scripts/webkitpy/layout_tests/controllers/manager.py:
+        * Scripts/webkitpy/layout_tests/controllers/manager_unittest.py:
+
+2011-07-06  Dirk Pranke  <[email protected]>
+
         nrwt: remove --use-apache from the command line
         https://bugs.webkit.org/show_bug.cgi?id=63358
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py (90527 => 90528)


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2011-07-07 02:49:47 UTC (rev 90527)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2011-07-07 03:18:51 UTC (rev 90528)
@@ -286,6 +286,8 @@
         #        options.results_directory, use_tls=True, port=9323)
 
         # a set of test files, and the same tests as a list
+
+        # FIXME: Rename to test_names.
         self._test_files = set()
         self._test_files_list = None
         self._result_queue = Queue.Queue()
@@ -663,12 +665,6 @@
                                         extract_and_flatten(some_shards)))
         return new_shards
 
-    def _contains_tests(self, subdir):
-        for test_file in self._test_files:
-            if test_file.find(subdir) >= 0:
-                return True
-        return False
-
     def _log_num_workers(self, num_workers, num_shards, num_locked_shards):
         driver_name = self._port.driver_name()
         if num_workers == 1:
@@ -813,14 +809,9 @@
 
         return (thread_timings, test_timings, individual_test_timings)
 
-    def needs_http(self):
-        """Returns whether the test runner needs an HTTP server."""
-        return self._contains_tests(self.HTTP_SUBDIR)
+    def needs_servers(self):
+        return any(self._test_requires_lock(test_name) for test_name in self._test_files)
 
-    def needs_websocket(self):
-        """Returns whether the test runner needs a WEBSOCKET server."""
-        return self._contains_tests(self.WEBSOCKET_SUBDIR)
-
     def set_up_run(self):
         """Configures the system to be ready to run tests.
 
@@ -836,7 +827,7 @@
         # Check that the system dependencies (themes, fonts, ...) are correct.
         if not self._options.nocheck_sys_deps:
             self._printer.print_update("Checking system dependencies ...")
-            if not self._port.check_sys_deps(self.needs_http()):
+            if not self._port.check_sys_deps(self.needs_servers()):
                 self._port.stop_helper()
                 return None
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py (90527 => 90528)


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py	2011-07-07 02:49:47 UTC (rev 90527)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py	2011-07-07 03:18:51 UTC (rev 90528)
@@ -31,6 +31,7 @@
 """Unit tests for manager.py."""
 
 import StringIO
+import sys
 import unittest
 
 from webkitpy.common.system import filesystem_mock
@@ -38,6 +39,7 @@
 from webkitpy.thirdparty.mock import Mock
 from webkitpy import layout_tests
 from webkitpy.layout_tests import port
+from webkitpy.layout_tests.port import port_testcase
 
 from webkitpy import layout_tests
 from webkitpy.layout_tests import run_webkit_tests
@@ -186,7 +188,42 @@
         manager._options.exit_after_n_failures = 10
         exception = self.assertRaises(TestRunInterruptedException, manager._interrupt_if_at_failure_limits, result_summary)
 
+    def test_needs_servers(self):
+        def get_manager_with_tests(test_names):
+            port = Mock()
+            port.TEST_PATH_SEPARATOR = '/'
+            manager = Manager(port, options=MockOptions(), printer=Mock())
+            manager._test_files = set(test_names)
+            manager._test_files_list = test_names
+            return manager
 
+        manager = get_manager_with_tests(['fast/html'])
+        self.assertFalse(manager.needs_servers())
+
+        manager = get_manager_with_tests(['http/tests/misc'])
+        self.assertTrue(manager.needs_servers())
+
+    def integration_test_needs_servers(self):
+        def get_manager_with_tests(test_names):
+            port = layout_tests.port.get()
+            manager = Manager(port, options=MockOptions(test_list=None), printer=Mock())
+            manager.collect_tests(test_names, last_unexpected_results=[])
+            return manager
+
+        manager = get_manager_with_tests(['fast/html'])
+        self.assertFalse(manager.needs_servers())
+
+        manager = get_manager_with_tests(['http/tests/mime'])
+        self.assertTrue(manager.needs_servers())
+
+        if sys.platform == 'win32':
+            manager = get_manager_with_tests(['fast\\html'])
+            self.assertFalse(manager.needs_servers())
+
+            manager = get_manager_with_tests(['http\\tests\\mime'])
+            self.assertTrue(manager.needs_servers())
+
+
 class NaturalCompareTest(unittest.TestCase):
     def assert_cmp(self, x, y, result):
         self.assertEquals(cmp(natural_sort_key(x), natural_sort_key(y)), result)
@@ -228,4 +265,4 @@
 
 
 if __name__ == '__main__':
-    unittest.main()
+    port_testcase.main()

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py (90527 => 90528)


--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2011-07-07 02:49:47 UTC (rev 90527)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2011-07-07 03:18:51 UTC (rev 90528)
@@ -109,7 +109,7 @@
         manager.parse_expectations()
 
         printer.print_update("Checking build ...")
-        if not port.check_build(manager.needs_http()):
+        if not port.check_build(manager.needs_servers()):
             _log.error("Build check failed")
             return -1
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to