WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
61248
Replace script_path with script_shell_command
https://bugs.webkit.org/show_bug.cgi?id=61248
Summary
Replace script_path with script_shell_command
Patrick R. Gansterer
Reported
2011-05-22 08:42:06 PDT
Replace script_path with script_shell_command
Attachments
Patch
(3.28 KB, patch)
2011-05-22 08:55 PDT
,
Patrick R. Gansterer
no flags
Details
Formatted Diff
Diff
Patch
(3.34 KB, patch)
2011-05-22 09:59 PDT
,
Patrick R. Gansterer
abarth
: review-
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Patrick R. Gansterer
Comment 1
2011-05-22 08:55:11 PDT
Created
attachment 94344
[details]
Patch
Adam Barth
Comment 2
2011-05-22 09:20:51 PDT
Comment on
attachment 94344
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=94344&action=review
> Tools/Scripts/webkitpy/common/checkout/scm/scm.py:94 > + if sys.platform == 'win32':
This file shouldn't depend on sys.platform. We're missing some sort of proper abstraction.
Adam Barth
Comment 3
2011-05-22 09:21:09 PDT
Also, we're missing tests.
Patrick R. Gansterer
Comment 4
2011-05-22 09:23:00 PDT
(In reply to
comment #2
)
> (From update of
attachment 94344
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=94344&action=review
> > > Tools/Scripts/webkitpy/common/checkout/scm/scm.py:94 > > + if sys.platform == 'win32': > > This file shouldn't depend on sys.platform. We're missing some sort of proper abstraction.
Any good ideas? Where is the correct/best place?
Adam Barth
Comment 5
2011-05-22 09:27:59 PDT
Comment on
attachment 94344
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=94344&action=review
>>> Tools/Scripts/webkitpy/common/checkout/scm/scm.py:94 >>> + if sys.platform == 'win32': >> >> This file shouldn't depend on sys.platform. We're missing some sort of proper abstraction. > > Any good ideas? Where is the correct/best place?
It seems like Executive.interpreter_for_script should do that work, possibly with a different name. Instead of having to branch on sys.platform everywhere we use a script, we should have a common abstraction do that for us.
Adam Barth
Comment 6
2011-05-22 09:29:17 PDT
http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/ports.py#L45
There's another place we have this branch. It should be moved to the common location also.
Patrick R. Gansterer
Comment 7
2011-05-22 09:29:54 PDT
(In reply to
comment #5
)
> (From update of
attachment 94344
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=94344&action=review
> > >>> Tools/Scripts/webkitpy/common/checkout/scm/scm.py:94 > >>> + if sys.platform == 'win32': > >> > >> This file shouldn't depend on sys.platform. We're missing some sort of proper abstraction. > > > > Any good ideas? Where is the correct/best place? > > It seems like Executive.interpreter_for_script should do that work, possibly with a different name. Instead of having to branch on sys.platform everywhere we use a script, we should have a common abstraction do that for us.
Where? Is Executive the right place?
Adam Barth
Comment 8
2011-05-22 09:34:23 PDT
> Where? Is Executive the right place?
Dunno. You should apply your design aesthetic and make a decision.
Patrick R. Gansterer
Comment 9
2011-05-22 09:59:10 PDT
Created
attachment 94348
[details]
Patch
Adam Barth
Comment 10
2011-05-22 10:24:59 PDT
Comment on
attachment 94348
[details]
Patch Looks good, but we need a test.
Patrick R. Gansterer
Comment 11
2011-05-22 10:32:50 PDT
(In reply to
comment #10
)
> (From update of
attachment 94348
[details]
) > Looks good, but we need a test.
Isn't that tested with the apply_patch tests already?
Adam Barth
Comment 12
2011-05-22 10:55:30 PDT
> Isn't that tested with the apply_patch tests already?
Seemingly not if this is broken on Windows.
Patrick R. Gansterer
Comment 13
2011-05-22 10:57:22 PDT
(In reply to
comment #12
)
> > Isn't that tested with the apply_patch tests already? > > Seemingly not if this is broken on Windows.
We do not run the test on native windows at the moment, because the don't work. ;-)
Adam Barth
Comment 14
2011-05-22 11:04:49 PDT
> We do not run the test on native windows at the moment, because the don't work. ;-)
My point is that unless this change is tested somewhere, I'm likely to break it next time I work on this code. Are we planning to run these tests on native windows? Can we write a test that checks that we're doing the right thing that works on every platform? Presumably we're passing something different to execute, so this should just be a matter of calling the appropriate function with a logging executive.
Patrick R. Gansterer
Comment 15
2011-05-22 11:13:00 PDT
(In reply to
comment #14
)
> > We do not run the test on native windows at the moment, because the don't work. ;-) > > My point is that unless this change is tested somewhere, I'm likely to break it next time I work on this code. Are we planning to run these tests on native windows? Can we write a test that checks that we're doing the right thing that works on every platform? > > Presumably we're passing something different to execute, so this should just be a matter of calling the appropriate function with a logging executive.
IMHO that's a chicken-and-egg problem. We can't run the native win32 test, when the don't work and we can't change the code if we don't test it. :-( The master bug for getting rid of cygwin is 48166. We call the script with interpreter only on windows (sys.platform == 'win32'), so we can't test it on other platform if we don't mock sys. I i don't like the idea of mocking sys. We have the same problem at
bug 55925
too.
Adam Barth
Comment 16
2011-05-22 20:29:35 PDT
Hum... Maybe Eric has an opinion. I definitely think this is valuable work, and I don't want to discourage you.
Adam Roben (:aroben)
Comment 17
2011-05-23 06:38:39 PDT
(In reply to
comment #15
)
> We call the script with interpreter only on windows (sys.platform == 'win32'), so we can't test it on other platform if we don't mock sys. I i don't like the idea of mocking sys.
Presumably we have code elsewhere that makes platform-dependent decisions. How do we test that code?
Adam Barth
Comment 18
2011-05-23 08:28:24 PDT
> Presumably we have code elsewhere that makes platform-dependent decisions. How do we test that code?
We have very, very little platform-dependent code. The layout_package has a bunch, which it tests by using a mock platform object. Maybe the best thing to do here is to run test-webkitpy in a non-cygwin configuration with a skipped list and then gradually remove tests from the skipped list as we fix them. That will ensure that we have test coverage.
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