[Webkit-unassigned] [Bug 141030] New: Web platform test server should not need to create __init__.py files

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 29 05:27:51 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=141030

            Bug ID: 141030
           Summary: Web platform test server should not need to create
                    __init__.py files
    Classification: Unclassified
           Product: WebKit
           Version: 528+ (Nightly build)
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Tools / Tests
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: youennf at gmail.com

Web Platform Test Server makes use of empty __init__.py files to enable module import.
Some bots seem to have difficulties with those empty __init__.py files as they do not show up in the file system.

The current solution implemented in Tools/Scripts/webkitpy/layout_tests/servers/web_platform_tests_layncher.py is to create those files if they do not exist.

A cleaner solution may be to detect those files when importing them and fill them with  a comment such as '# Required for Python to search this directory for module files'.

In addition a webkitpy unit test should be added to ensure that wpt module import is working in webkitpy.layout_tests.servers.web_platform_test_server_unittest.py, something like:
    def test_import_web_platform_test_modules(self):
        fs = FileSystem()
        current_dir, name = fs.split(fs.realpath(__file__))
        doc_root_dir = fs.join(current_dir, "..", "..", "..", "..", "..", "LayoutTests", "imported", "w3c", "web-platform-tests")
        tools_dir = fs.join(doc_root_dir, "tools")

        sys.path.insert(0, doc_root_dir)
        try:
            file, pathname, description = imp.find_module("tools")
        except ImportError, e:
            self.fail(e)
        self.assertEqual(pathname, tools_dir)
        sys.path.pop(0)

        sys.path.insert(0, tools_dir)
        try:
            file, pathname, description = imp.find_module("scripts")
        except ImportError, e:
            self.fail(e)
        self.assertEqual(pathname, fs.join(tools_dir, "scripts"))
        sys.path.pop(0)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150129/1dfdc448/attachment-0002.html>


More information about the webkit-unassigned mailing list