WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
103900
Many webkitpy unit tests can be run standalone, are executable
https://bugs.webkit.org/show_bug.cgi?id=103900
Summary
Many webkitpy unit tests can be run standalone, are executable
Zan Dobersek
Reported
2012-12-03 08:57:50 PST
There are many unit tests in webkitpy containing the following two lines at the bottom: if __name__=='__main__': unittest.main() Some unit test files are even executable and/or containing the shebang line at the top of the file. I guess there was once a tendency to be able to run only specific unit tests. Given that today the tests, when running test-webkitpy, are run in parallel and can be narrowed down via the command line, is there still a requirement for that?
Attachments
Patch
(50.80 KB, patch)
2012-12-04 00:57 PST
,
Zan Dobersek
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Dirk Pranke
Comment 1
2012-12-03 10:16:08 PST
As you say, I originally ran many of the unit tests individually to test modules; partially this was because of python convention, and partially this was because test-webkitpy was pretty bare-bones and missing a bunch of stuff I needed (like being able to get coverage numbers). I've added all of the features to test-webkitpy since then, and rarely run the tests directly now, so there's no real reason to keep these lines. (The other people who did python development, like eseidel and abarth, pretty much never used these lines in the first place, so I don't think anyone will object to removing them across the board).
Eric Seidel (no email)
Comment 2
2012-12-03 10:20:43 PST
Nope. :) Go for it.
Zan Dobersek
Comment 3
2012-12-04 00:57:52 PST
Created
attachment 177438
[details]
Patch
Zan Dobersek
Comment 4
2012-12-04 01:02:29 PST
(In reply to
comment #3
)
> Created an attachment (id=177438) [details] > Patch
This patch only covers unit tests, but there are other files as well that contain shebang lines and are executable. I'll spin up another patch for those.
Eric Seidel (no email)
Comment 5
2012-12-04 01:07:00 PST
Comment on
attachment 177438
[details]
Patch LGTM. But you probably want to wait for Dirk to confirm.
Dirk Pranke
Comment 6
2012-12-04 11:06:52 PST
Comment on
attachment 177438
[details]
Patch looks fine.
Zan Dobersek
Comment 7
2012-12-04 12:35:03 PST
Comment on
attachment 177438
[details]
Patch Clearing flags on attachment: 177438 Committed
r136548
: <
http://trac.webkit.org/changeset/136548
>
Zan Dobersek
Comment 8
2012-12-04 12:35:09 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug