Bug 77058 - test-webkitpy: executive_unittest fails if PYTHONPATH isn't set
Summary: test-webkitpy: executive_unittest fails if PYTHONPATH isn't set
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-01-25 16:38 PST by Dirk Pranke
Modified: 2012-01-26 10:27 PST (History)
4 users (show)

See Also:


Attachments
Patch (2.50 KB, patch)
2012-01-25 16:38 PST, Dirk Pranke
no flags Details | Formatted Diff | Diff
fix ChangeLog (2.86 KB, patch)
2012-01-25 16:41 PST, Dirk Pranke
eric: review+
eric: commit-queue-
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-01-25 16:38:10 PST
test-webkitpy: executive_unittest fails if PYTHONPATH isn't set
Comment 1 Dirk Pranke 2012-01-25 16:38:28 PST
Created attachment 124032 [details]
Patch
Comment 2 Dirk Pranke 2012-01-25 16:41:23 PST
Created attachment 124034 [details]
fix ChangeLog
Comment 3 Eric Seidel (no email) 2012-01-25 16:45:14 PST
Comment on attachment 124034 [details]
fix ChangeLog

This seems ugly.  Is this the best way to go?
Comment 4 Dirk Pranke 2012-01-25 16:48:00 PST
Without the PYTHONPATH settings, the script'll choke on the "from webkit... import lines" since it doesn't know where webkitpy is. We could probably change those to just "import executive" and have it work, but that's not normal python style. I'm open to other suggestions.
Comment 5 Dirk Pranke 2012-01-25 16:50:37 PST
Actually, if you think about it, it might be a good thing for the unit tests for executive to be ensuring what the PYTHONPATH  is set to, regardless.
Comment 6 Eric Seidel (no email) 2012-01-25 17:33:24 PST
Comment on attachment 124034 [details]
fix ChangeLog

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

I don't really like this, but I also don't think it matters that much.  Please add a comment about why we're doing this.  Specifically to allow this unittest to call itself.

> Tools/Scripts/test-webkitpy:45
> +    webkit_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

Why is this needed?  __file__ should always be absolute, no?
Comment 7 Dirk Pranke 2012-01-25 17:41:25 PST
(In reply to comment #6)
> (From update of attachment 124034 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=124034&action=review
> 
> I don't really like this, but I also don't think it matters that much.  Please add a comment about why we're doing this.  Specifically to allow this unittest to call itself.
> 

Will do.

> > Tools/Scripts/test-webkitpy:45
> > +    webkit_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
> 
> Why is this needed?  __file__ should always be absolute, no?

No, it isn't. Try running ./test-webkitpy and you'll see :(.
Comment 8 Dirk Pranke 2012-01-25 17:47:53 PST
Committed r105954: <http://trac.webkit.org/changeset/105954>
Comment 9 Adam Barth 2012-01-26 01:40:49 PST
This didn't fix the problem.
Comment 10 Dirk Pranke 2012-01-26 10:27:11 PST
(In reply to comment #9)
> This didn't fix the problem.

Hm. Consider me completely befuddled, then. I will look into it.