Bug 82158 - add a Tree abstraction to test-webkitpy to better encapsulate things
Summary: add a Tree abstraction to test-webkitpy to better encapsulate things
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dirk Pranke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-25 19:01 PDT by Dirk Pranke
Modified: 2012-03-26 14:58 PDT (History)
3 users (show)

See Also:


Attachments
Patch (9.81 KB, patch)
2012-03-25 19:08 PDT, Dirk Pranke
no flags Details | Formatted Diff | Diff
fix typos (9.85 KB, patch)
2012-03-25 19:10 PDT, Dirk Pranke
no flags Details | Formatted Diff | Diff
rename _Tree to TestDirectoryTree (9.98 KB, patch)
2012-03-26 14:56 PDT, 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 2012-03-25 19:01:03 PDT
add a Tree abstraction to test-webkitpy to better encapsulate things
Comment 1 Dirk Pranke 2012-03-25 19:08:28 PDT
Created attachment 133712 [details]
Patch
Comment 2 Dirk Pranke 2012-03-25 19:10:38 PDT
Created attachment 133713 [details]
fix typos
Comment 3 Adam Barth 2012-03-26 10:26:23 PDT
Comment on attachment 133713 [details]
fix typos

View in context: https://bugs.webkit.org/attachment.cgi?id=133713&action=review

> Tools/Scripts/webkitpy/test/main.py:238
> +class _Tree(object):

Do you mean a DirectoryTree?  "Tree" is a very broad name.  This code seems very specific to Python packages.
Comment 4 Dirk Pranke 2012-03-26 11:11:44 PDT
Comment on attachment 133713 [details]
fix typos

View in context: https://bugs.webkit.org/attachment.cgi?id=133713&action=review

>> Tools/Scripts/webkitpy/test/main.py:238
>> +class _Tree(object):
> 
> Do you mean a DirectoryTree?  "Tree" is a very broad name.  This code seems very specific to Python packages.

Yes, it refers to directory trees and is intended to by very python-specific. DirectoryTree is a fine name; other suggestions welcome.
Comment 5 Adam Barth 2012-03-26 14:15:31 PDT
Comment on attachment 133713 [details]
fix typos

I'd rename _Tree to something more specific (and maybe put it at the top of the file?).  There's an argument that says we should put the new class in its own module, which would have the benefit of making test-webkitpy smaller.  If we did that we, we'd probably want to use filesystem rather than os.path.  I think it's a question of how far you'd like to shave this yak.
Comment 6 Dirk Pranke 2012-03-26 14:22:28 PDT
(In reply to comment #5)
> (From update of attachment 133713 [details])
> I'd rename _Tree to something more specific (and maybe put it at the top of the file?).  There's an argument that says we should put the new class in its own module, which would have the benefit of making test-webkitpy smaller.  If we did that we, we'd probably want to use filesystem rather than os.path.  I think it's a question of how far you'd like to shave this yak.

Okay, I will rename and move it. 

I don't see much advantage to putting it in a different file, since I don't think anyone else will want to use it, and main.py isn't very big as it is.

Thanks for the review!
Comment 7 Dirk Pranke 2012-03-26 14:56:06 PDT
Created attachment 133899 [details]
rename _Tree to TestDirectoryTree
Comment 8 Dirk Pranke 2012-03-26 14:58:25 PDT
Committed r112150: <http://trac.webkit.org/changeset/112150>