Bug 54525 - webkitpy.common.net.testoutputset_unittest.TestOutputSetTest.test_can_infer_platform_from_path_if_none_provided fails on win32
Summary: webkitpy.common.net.testoutputset_unittest.TestOutputSetTest.test_can_infer_p...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 48728
  Show dependency treegraph
 
Reported: 2011-02-15 19:49 PST by Dirk Pranke
Modified: 2011-05-31 18:37 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.99 KB, patch)
2011-02-17 19:23 PST, Dirk Pranke
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Pranke 2011-02-15 19:49:08 PST
There's actually a couple of places that get confused by os.path.sep being '\\' on win32, but in this particular test it's not clear what the right fix is, since I'm not sure if zip files should follow the platform, or always use '/'.
Comment 1 Dirk Pranke 2011-02-17 19:23:14 PST
Created attachment 82902 [details]
Patch
Comment 2 Dirk Pranke 2011-02-17 19:54:20 PST
Note that we don't actually want to land/review the patch I just uploaded. We can handle the skipping via the blacklist in bug 54709 and should use this bug to fix it properly.
Comment 3 Dirk Pranke 2011-02-18 19:32:08 PST
The issue is that we insert file paths into the zip file with forward slashes as separators, but when we turn the file path into a filesethandle, we use the native filesystem, which on win32 uses backward slashes as separators. Hence we fail to parse the path correctly and don't extract the "win" component properly.

I'm not sure what the right fix is. I'm pretty sure zip files will always return forward slashes, so I think that part of the code is acting correctly. Perhaps the TestOutput and TestOutputSet() classes should have a filesystem handles passed to their constructors, and we should always pass it MockFileSystems (or some other filesystem-interface-implement object) when we're extracting zip files using TestOutputSet().from_zip() or TestOutputSet().from_zip_url()?

Koz, you wrote this code, does that sound about right?
Comment 4 Dirk Pranke 2011-05-31 18:37:48 PDT
disclaiming ownership on this, in case anyone else wants to work on it.