[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

eric at webkit.org eric at webkit.org
Wed Dec 22 14:44:19 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 69b77cfff2f37b2e0a8402e1b1c97f7d4f2a0314
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 18 23:08:33 2010 +0000

    2010-10-18  Eric Seidel  <eric at webkit.org>
    
            Reviewed by Adam Barth.
    
            Add Queue class and add minimal unittesting of QueueStatusServer code
            https://bugs.webkit.org/show_bug.cgi?id=47847
    
            * QueueStatusServer/handlers/dashboard.py:
            * QueueStatusServer/handlers/queuestatus.py:
            * QueueStatusServer/handlers/recentstatus.py:
            * QueueStatusServer/handlers/statusbubble.py:
            * QueueStatusServer/handlers/updateworkitems.py:
            * QueueStatusServer/model/attachment.py:
            * QueueStatusServer/model/queues.py:
            * QueueStatusServer/model/queues_unittest.py: Added.
            * QueueStatusServer/model/svnrevision.py:
            * Scripts/test-webkitpy:
            * Scripts/webkitpy/test/main.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70006 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 9f68e3e..23c991c 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,22 @@
+2010-10-18  Eric Seidel  <eric at webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Add Queue class and add minimal unittesting of QueueStatusServer code
+        https://bugs.webkit.org/show_bug.cgi?id=47847
+
+        * QueueStatusServer/handlers/dashboard.py:
+        * QueueStatusServer/handlers/queuestatus.py:
+        * QueueStatusServer/handlers/recentstatus.py:
+        * QueueStatusServer/handlers/statusbubble.py:
+        * QueueStatusServer/handlers/updateworkitems.py:
+        * QueueStatusServer/model/attachment.py:
+        * QueueStatusServer/model/queues.py:
+        * QueueStatusServer/model/queues_unittest.py: Added.
+        * QueueStatusServer/model/svnrevision.py:
+        * Scripts/test-webkitpy:
+        * Scripts/webkitpy/test/main.py:
+
 2010-10-18  Anders Carlsson  <andersca at apple.com>
 
         Fix build.
diff --git a/WebKitTools/QueueStatusServer/handlers/dashboard.py b/WebKitTools/QueueStatusServer/handlers/dashboard.py
index 26de263..3b93fff 100644
--- a/WebKitTools/QueueStatusServer/handlers/dashboard.py
+++ b/WebKitTools/QueueStatusServer/handlers/dashboard.py
@@ -32,31 +32,16 @@ from google.appengine.ext import webapp
 from google.appengine.ext.webapp import template
 
 from model.attachment import Attachment
-from model.queues import queues
+from model.queues import Queue
 
 
 class Dashboard(webapp.RequestHandler):
+    # We may want to sort these?
+    _ordered_queues = Queue.all()
+    _header_names = [queue.short_name() for queue in _ordered_queues]
 
-    # FIXME: This list probably belongs as part of a Queue object in queues.py
-    # Arrays are bubble_name, queue_name
-    # FIXME: Can this be unified with StatusBubble._queues_to_display?
-    _queues_to_display = [
-        ["Style", "style-queue"],
-        ["Cr-Linux", "chromium-ews"],
-        ["Qt", "qt-ews"],
-        ["Gtk", "gtk-ews"],
-        ["Mac", "mac-ews"],
-        ["Win", "win-ews"],
-        ["Commit", "commit-queue"],
-    ]
-    # Split the zipped list into component parts
-    _header_names, _ordered_queue_names = zip(*_queues_to_display)
-
-    # This asserts that all of the queues listed above are valid queue names.
-    assert(reduce(operator.and_, map(lambda name: name in queues, _ordered_queue_names)))
-
-    def _build_bubble(self, attachment, queue_name):
-        queue_status = attachment.status_for_queue(queue_name)
+    def _build_bubble(self, attachment, queue):
+        queue_status = attachment.status_for_queue(queue.name())
         bubble = {
             "status_class": attachment.state_from_queue_status(queue_status) if queue_status else "none",
             "status_date": queue_status.date if queue_status else None,
@@ -67,7 +52,7 @@ class Dashboard(webapp.RequestHandler):
         row = {
             "bug_id": attachment.bug_id(),
             "attachment_id": attachment.id,
-            "bubbles": [self._build_bubble(attachment, queue_name) for queue_name in self._ordered_queue_names],
+            "bubbles": [self._build_bubble(attachment, queue) for queue in self._ordered_queues],
         }
         return row
 
diff --git a/WebKitTools/QueueStatusServer/handlers/queuestatus.py b/WebKitTools/QueueStatusServer/handlers/queuestatus.py
index 0259c37..2b9a378 100644
--- a/WebKitTools/QueueStatusServer/handlers/queuestatus.py
+++ b/WebKitTools/QueueStatusServer/handlers/queuestatus.py
@@ -29,7 +29,7 @@
 from google.appengine.ext import webapp
 from google.appengine.ext.webapp import template
 
-from model.queues import queues, display_name_for_queue
+from model.queues import Queue
 from model.workitems import WorkItems
 from model.activeworkitems import ActiveWorkItems
 
@@ -50,9 +50,14 @@ class QueueStatus(webapp.RequestHandler):
         return rows
 
     def get(self, queue_name):
-        queued_items = WorkItems.all().filter("queue_name =", queue_name).get()
-        active_items = ActiveWorkItems.all().filter("queue_name =", queue_name).get()
-        statuses = queuestatus.QueueStatus.all().filter("queue_name =", queue_name).order("-date").fetch(15)
+        queue_name = queue_name.lowercase()
+        queue = Queue.queue_with_name(queue_name)
+        if not queue:
+            self.error(404)
+
+        queued_items = WorkItems.all().filter("queue_name =", queue.name()).get()
+        active_items = ActiveWorkItems.all().filter("queue_name =", queue.name()).get()
+        statuses = queuestatus.QueueStatus.all().filter("queue_name =", queue.name()).order("-date").fetch(15)
 
         status_groups = []
         last_patch_id = None
@@ -69,7 +74,7 @@ class QueueStatus(webapp.RequestHandler):
             last_patch_id = patch_id
 
         template_values = {
-            "display_queue_name": display_name_for_queue(queue_name),
+            "display_queue_name": queue.display_name(),
             "work_item_rows": self._rows_for_work_items(queued_items, active_items),
             "status_groups": status_groups,
         }
diff --git a/WebKitTools/QueueStatusServer/handlers/recentstatus.py b/WebKitTools/QueueStatusServer/handlers/recentstatus.py
index e2b8c2f..eba901f 100644
--- a/WebKitTools/QueueStatusServer/handlers/recentstatus.py
+++ b/WebKitTools/QueueStatusServer/handlers/recentstatus.py
@@ -31,23 +31,24 @@ import datetime
 from google.appengine.ext import webapp
 from google.appengine.ext.webapp import template
 
-from model.queues import queues, display_name_for_queue
+from model.queues import Queue
 from model.queuestatus import QueueStatus
 from model.workitems import WorkItems
 
 
 class QueueBubble(object):
     """View support class for recentstatus.html"""
-    def __init__(self, queue_name):
-        self._queue_name = queue_name
-        self._work_items = WorkItems.all().filter("queue_name =", queue_name).get()
-        self._last_status = QueueStatus.all().filter("queue_name =", queue_name).order("-date").get()
+    def __init__(self, queue):
+        self._queue = queue
+        self._work_items = WorkItems.all().filter("queue_name =", queue.name()).get()
+        self._last_status = QueueStatus.all().filter("queue_name =", queue.name()).order("-date").get()
 
+    # FIXME: name and display_name should be replaced by a .queue() accessor.
     def name(self):
-        return self._queue_name
+        return self._queue.name()
 
     def display_name(self):
-        return display_name_for_queue(self._queue_name)
+        return self._queue.display_name()
 
     def _last_status_date(self):
         if not self._last_status:
@@ -88,6 +89,6 @@ class QueuesOverview(webapp.RequestHandler):
 
     def get(self):
         template_values = {
-            "queues": [QueueBubble(queue_name) for queue_name in queues],
+            "queues": [QueueBubble(queue) for queue in Queue.all()],
         }
         self.response.out.write(template.render("templates/recentstatus.html", template_values))
diff --git a/WebKitTools/QueueStatusServer/handlers/statusbubble.py b/WebKitTools/QueueStatusServer/handlers/statusbubble.py
index 8b6614b..3bad6d1 100644
--- a/WebKitTools/QueueStatusServer/handlers/statusbubble.py
+++ b/WebKitTools/QueueStatusServer/handlers/statusbubble.py
@@ -33,34 +33,18 @@ from google.appengine.ext.webapp import template
 
 from model.attachment import Attachment
 from model.workitems import WorkItems
-from model.queues import queues, name_with_underscores
+from model.queues import Queue
 
 
 class StatusBubble(webapp.RequestHandler):
-    # FIXME: This list probably belongs as part of a Queue object in queues.py
-    # Arrays are bubble_name, queue_name
-    _queues_to_display = [
-        ["style", "style-queue"],
-        ["cr-linux", "chromium-ews"],
-        ["gtk", "gtk-ews"],
-        ["qt", "qt-ews"],
-        ["mac", "mac-ews"],
-        ["win", "win-ews"],
-        ["efl", "efl-ews"],
-    ]
+    _queues_to_display = [queue for queue in Queue.all() if queue.is_ews()]
 
-    # This asserts that all of the queues listed above are valid queue names.
-    assert(reduce(operator.and_, map(lambda name_pair: name_pair[1] in queues, _queues_to_display)))
-
-    def _build_bubble(self, queue_name_pair, attachment):
-        bubble_name = queue_name_pair[0]
-        queue_name = queue_name_pair[1]
-
-        queue_status = attachment.status_for_queue(queue_name)
+    def _build_bubble(self, queue, attachment):
+        queue_status = attachment.status_for_queue(queue.name())
         bubble = {
-            "name": bubble_name,
+            "name": queue.short_name().lowercase(),
             "attachment_id": attachment.id,
-            "queue_position": attachment.position_in_queue(queue_name),
+            "queue_position": attachment.position_in_queue(queue.name()),
             "state": attachment.state_from_queue_status(queue_status) if queue_status else "none",
             "status": queue_status,
         }
@@ -68,7 +52,7 @@ class StatusBubble(webapp.RequestHandler):
 
     def get(self, attachment_id):
         attachment = Attachment(int(attachment_id))
-        bubbles = [self._build_bubble(name_pair, attachment) for name_pair in self._queues_to_display]
+        bubbles = [self._build_bubble(queue, attachment) for queue in self._queues_to_display]
         template_values = {
             "bubbles": bubbles,
         }
diff --git a/WebKitTools/QueueStatusServer/handlers/updateworkitems.py b/WebKitTools/QueueStatusServer/handlers/updateworkitems.py
index f91beb4..41d96b6 100644
--- a/WebKitTools/QueueStatusServer/handlers/updateworkitems.py
+++ b/WebKitTools/QueueStatusServer/handlers/updateworkitems.py
@@ -30,7 +30,7 @@ from google.appengine.ext import webapp, db
 from google.appengine.ext.webapp import template
 
 from handlers.updatebase import UpdateBase
-from model.queues import queues
+from model.queues import Queue
 from model.workitems import WorkItems
 
 from datetime import datetime
@@ -41,8 +41,9 @@ class UpdateWorkItems(UpdateBase):
         self.response.out.write(template.render("templates/updateworkitems.html", None))
 
     def _work_items_for_queue(self, queue_name):
-        if queue_name not in queues:
-            self.response.out.write("\"%s\" is not in queues %s" % (queue_name, queues))
+        queue = Queue.queue_for_name(queue_name)
+        if queue:
+            self.response.out.write("\"%s\" is not in queues %s" % (queue_name, Queue.all()))
             return None
         work_items = WorkItems.all().filter("queue_name =", queue_name).get()
         if not work_items:
diff --git a/WebKitTools/QueueStatusServer/model/attachment.py b/WebKitTools/QueueStatusServer/model/attachment.py
index 9ae59e8..a8f67fa 100644
--- a/WebKitTools/QueueStatusServer/model/attachment.py
+++ b/WebKitTools/QueueStatusServer/model/attachment.py
@@ -30,7 +30,7 @@ import re
 
 from google.appengine.api import memcache
 
-from model.queues import queues, name_with_underscores
+from model.queues import Queue
 from model.queuestatus import QueueStatus
 from model.workitems import WorkItems
 
@@ -91,7 +91,7 @@ class Attachment(object):
         return self._queue_positions().get(queue_name)
 
     def status_for_queue(self, queue_name):
-        underscore_queue_name = name_with_underscores(queue_name)
+        underscore_queue_name = Queue(queue_name).name_with_underscores()
         # summary() is a horrible API and should be killed.
         queue_summary = self.summary().get(underscore_queue_name)
         if not queue_summary:
@@ -134,7 +134,9 @@ class Attachment(object):
             summary[queue] = None
             status = QueueStatus.all().filter('queue_name =', queue).filter('active_patch_id =', self.id).order('-date').get()
             if status:
-                summary[name_with_underscores(queue)] = {
+                queue_name = Queue(queue_name).name_with_underscores()
+                # summary() is a horrible API and should be killed.
+                summary[queue_name] = {
                     "state": self.state_from_queue_status(status),
                     "status": status,
                 }
diff --git a/WebKitTools/QueueStatusServer/model/queues.py b/WebKitTools/QueueStatusServer/model/queues.py
index 9658dd4..9ca1e1e 100644
--- a/WebKitTools/QueueStatusServer/model/queues.py
+++ b/WebKitTools/QueueStatusServer/model/queues.py
@@ -26,39 +26,66 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+
 import re
 
 
-queues = [
-    "commit-queue",
-    "style-queue",
-    "chromium-ews",
-    "qt-ews",
-    "gtk-ews",
-    "mac-ews",
-    "win-ews",
-    "efl-ews",
-]
+class Queue(object):
+
+    # Eventually the list of queues may be stored in the data store.
+    _all_queue_names = [
+        "commit-queue",
+        "style-queue",
+        "chromium-ews",
+        "qt-ews",
+        "gtk-ews",
+        "mac-ews",
+        "win-ews",
+        "efl-ews",
+    ]
+
+    def __init__(self, name):
+        assert(name in self._all_queue_names)
+        self._name = name
+
+    @classmethod
+    def queue_with_name(cls, queue_name):
+        if queue_name not in cls._all_queue_names:
+            return None
+        return Queue(queue_name)
+
+    @classmethod
+    def all(cls):
+        return [Queue(name) for name in cls._all_queue_names]
+
+    def name(self):
+        return self._name
 
+    def _caplitalize_after_dash(self, string):
+        return "-".join([word[0].upper() + word[1:] for word in string.split("-")])
 
-# FIXME: We need some sort of Queue object.
-def _title_case(string):
-    words = string.split(" ")
-    words = map(lambda word: word.capitalize(), words)
-    return " ".join(words)
+    # For use in status bubbles or table headers
+    def short_name(self):
+        # HACK: chromium-ews is incorrectly named.
+        short_name = self._name.replace("chromium-ews", "Cr-Linux-ews")
+        short_name = short_name.replace("-ews", "")
+        short_name = short_name.replace("-queue", "")
+        return self._caplitalize_after_dash(short_name.capitalize())
 
+    def display_name(self):
+        # HACK: chromium-ews is incorrectly named.
+        display_name = self._name.replace("chromium-ews", "cr-linux-ews")
 
-def display_name_for_queue(queue_name):
-    # HACK: chromium-ews is incorrectly named.
-    display_name = queue_name.replace("chromium-ews", "cr-linux-ews")
+        display_name = display_name.replace("-", " ")
+        display_name = display_name.replace("cr", "chromium")
+        display_name = display_name.title()
+        display_name = display_name.replace("Ews", "EWS")
+        return display_name
 
-    display_name = display_name.replace("-", " ")
-    display_name = display_name.replace("cr", "chromium")
-    display_name = _title_case(display_name)
-    display_name = display_name.replace("Ews", "EWS")
-    return display_name
+    _dash_regexp = re.compile("-")
 
+    def name_with_underscores(self):
+        return self._dash_regexp.sub("_", self._name)
 
-def name_with_underscores(dashed_name):
-    regexp = re.compile("-")
-    return regexp.sub("_", dashed_name)
+    def is_ews(self):
+        return self._name.endswith("-ews")
diff --git a/WebKitTools/QueueStatusServer/model/queues_unittest.py b/WebKitTools/QueueStatusServer/model/queues_unittest.py
new file mode 100644
index 0000000..33070a8
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/model/queues_unittest.py
@@ -0,0 +1,73 @@
+# Copyright (C) 2010 Google, Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#    * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#    * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#    * Neither the name of Research in Motion Ltd. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+
+from model.queues import Queue
+
+
+class QueueTest(unittest.TestCase):
+    def test_is_ews(self):
+        mac_ews = Queue("mac-ews")
+        self.assertTrue(mac_ews.is_ews())
+
+    def test_queue_with_name(self):
+        self.assertEqual(Queue.queue_with_name("bogus"), None)
+        self.assertEqual(Queue.queue_with_name("mac-ews").name(), "mac-ews")
+        self.assertRaises(AssertionError, Queue, ("bogus"))
+
+    def _assert_short_name(self, queue_name, short_name):
+        self.assertEquals(Queue(queue_name).short_name(), short_name)
+
+    def test_short_name(self):
+        self._assert_short_name("mac-ews", "Mac")
+        self._assert_short_name("chromium-ews", "Cr-Linux")
+        self._assert_short_name("commit-queue", "Commit")
+        self._assert_short_name("style-queue", "Style")
+
+    def _assert_display_name(self, queue_name, short_name):
+        self.assertEquals(Queue(queue_name).display_name(), short_name)
+
+    def test_display_name(self):
+        self._assert_display_name("mac-ews", "Mac EWS")
+        self._assert_display_name("chromium-ews", "Chromium Linux EWS")
+        self._assert_display_name("commit-queue", "Commit Queue")
+        self._assert_display_name("style-queue", "Style Queue")
+
+    def _assert_name_with_underscores(self, queue_name, short_name):
+        self.assertEquals(Queue(queue_name).name_with_underscores(), short_name)
+
+    def test_name_with_underscores(self):
+        self._assert_name_with_underscores("mac-ews", "mac_ews")
+        self._assert_name_with_underscores("chromium-ews", "chromium_ews")
+        self._assert_name_with_underscores("commit-queue", "commit_queue")
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/WebKitTools/QueueStatusServer/model/svnrevision.py b/WebKitTools/QueueStatusServer/model/svnrevision.py
index 70ec0cc..f5d3644 100644
--- a/WebKitTools/QueueStatusServer/model/svnrevision.py
+++ b/WebKitTools/QueueStatusServer/model/svnrevision.py
@@ -28,6 +28,7 @@
 
 from google.appengine.ext import db
 
+
 class SVNRevision(db.Model):
     number = db.IntegerProperty()
     broken_bots = db.StringListProperty(default=[])
diff --git a/WebKitTools/Scripts/test-webkitpy b/WebKitTools/Scripts/test-webkitpy
index be7e870..fcff4b4 100755
--- a/WebKitTools/Scripts/test-webkitpy
+++ b/WebKitTools/Scripts/test-webkitpy
@@ -227,9 +227,30 @@ def init(command_args, external_package_paths):
         _log.warn(message)
 
 
-if __name__ == "__main__":
+def _path_from_webkit_root(*components):
+    webkit_root = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
+    return os.path.join(webkit_root, *components)
+
+
+def _test_import(module_path):
+    try:
+        sys.path.append(os.path.dirname(module_path))
+        module_name = os.path.basename(module_path)
+        __import__(module_name)
+        return True
+    except Exception, e:
+        message = "Skipping tests in %s due to failure (%s)." % (module_path, e)
+        if module_name.endswith("QueueStatusServer"):
+            message += "  This module is optional.  The failure is likely due to a missing Google AppEngine install.  (http://code.google.com/appengine/downloads.html)"
+        _log.warn(message)
+        return False
 
-    external_package_paths = [os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'WebKit2', 'Scripts', 'webkit2')]
+if __name__ == "__main__":
+    # FIXME: We should probably test each package separately to avoid naming conflicts.
+    external_package_paths = [
+        _path_from_webkit_root('WebKit2', 'Scripts', 'webkit2'),
+        _path_from_webkit_root('WebKitTools', 'QueueStatusServer'),
+    ]
     init(sys.argv[1:], external_package_paths)
 
     # We import the unit test code after init() to ensure that any
@@ -240,4 +261,6 @@ if __name__ == "__main__":
     # running the unit tests.
     from webkitpy.test.main import Tester
 
+    external_package_paths = filter(_test_import, external_package_paths)
+
     Tester().run_tests(sys.argv, external_package_paths)
diff --git a/WebKitTools/Scripts/webkitpy/test/main.py b/WebKitTools/Scripts/webkitpy/test/main.py
index 9351768..1038d82 100644
--- a/WebKitTools/Scripts/webkitpy/test/main.py
+++ b/WebKitTools/Scripts/webkitpy/test/main.py
@@ -50,12 +50,12 @@ class Tester(object):
 
         return unittest_paths
 
-    def _modules_from_paths(self, webkitpy_dir, paths):
+    def _modules_from_paths(self, package_root, paths):
         """Return a list of fully-qualified module names given paths."""
-        webkitpy_dir = os.path.abspath(webkitpy_dir)
-        webkitpy_name = os.path.split(webkitpy_dir)[1]  # Equals "webkitpy".
+        package_path = os.path.abspath(package_root)
+        root_package_name = os.path.split(package_path)[1]  # Equals "webkitpy".
 
-        prefix_length = len(webkitpy_dir)
+        prefix_length = len(package_path)
 
         modules = []
         for path in paths:
@@ -72,7 +72,8 @@ class Tester(object):
                     break
                 parts.insert(0, tail)
             # We now have, for example: common.config.ports_unittest
-            parts.insert(0, webkitpy_name)  # Put "webkitpy" at the beginning.
+            # FIXME: This is all a hack around the fact that we always prefix webkitpy includes with "webkitpy."
+            parts.insert(0, root_package_name)  # Put "webkitpy" at the beginning.
             module = ".".join(parts)
             modules.append(module)
 
@@ -91,6 +92,9 @@ class Tester(object):
         if external_package_paths is None:
             external_package_paths = []
         else:
+            # FIXME: We should consider moving webkitpy off of using "webkitpy." to prefix
+            # all includes.  If we did that, then this would use path instead of dirname(path).
+            # QueueStatusServer.__init__ has a sys.path import hack due to this code.
             sys.path.extend(set(os.path.dirname(path) for path in external_package_paths))
 
         if len(sys_argv) > 1 and not sys_argv[-1].startswith("-"):
@@ -101,6 +105,7 @@ class Tester(object):
 
         # Otherwise, auto-detect all unit tests.
 
+        # FIXME: This should be combined with the external_package_paths code above.
         webkitpy_dir = os.path.dirname(webkitpy.__file__)
 
         modules = []

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list