Bug 229253

Summary: Add a new option '--show-window' to run-webkit-tests
Product: WebKit Reporter: Peng Liu <peng.liu6>
Component: Tools / TestsAssignee: Peng Liu <peng.liu6>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, ews-watchlist, glenn, jbedard, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 232059    
Attachments:
Description Flags
Patch
simon.fraser: review+, ews-feeder: commit-queue-
Revise the patch based on Simon's comment
none
Revise the patch based on Alexey's comment
ews-feeder: commit-queue-
Fix build failures on the win bot none

Description Peng Liu 2021-08-18 14:56:32 PDT
Add a new option '--show-webview' to run-webkit-tests
Comment 1 Peng Liu 2021-08-18 15:19:54 PDT
Created attachment 435805 [details]
Patch
Comment 2 Simon Fraser (smfr) 2021-08-18 15:29:12 PDT
Comment on attachment 435805 [details]
Patch

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

> Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py:343
> +        optparse.make_option('--show-window', action="store_true", default=False, help="If set, a window (with webview) will show up. Helpful for debugging some tests."),

I think the help should say "Make the test runner window visible during testing"
Comment 3 Peng Liu 2021-08-18 15:48:38 PDT
Created attachment 435809 [details]
Revise the patch based on Simon's comment
Comment 4 Peng Liu 2021-08-18 15:50:14 PDT
Comment on attachment 435805 [details]
Patch

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

>> Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py:343
>> +        optparse.make_option('--show-window', action="store_true", default=False, help="If set, a window (with webview) will show up. Helpful for debugging some tests."),
> 
> I think the help should say "Make the test runner window visible during testing"

Fixed. Thanks!
Comment 5 Jonathan Bedard 2021-08-18 15:54:20 PDT
Comment on attachment 435809 [details]
Revise the patch based on Simon's comment

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

> Tools/WebKitTestRunner/Options.cpp:169
> +    optionList.append(Option("--show-window", "Show the WebView during test runs (for debugging)", handleOptionShowWebView));

Why add the new option here instead of just passing --show-webview in the options? If we wanted to keep the option and name aligned, when creating the option, we could do this:

optparse.make_option('--show-window', '--show-webview', dest='show_webview', ...)

which would make the option inside webkitpy 'show_webview', but the option '--show-window' with an alias '--show-webview'
Comment 6 Peng Liu 2021-08-18 16:04:21 PDT
Comment on attachment 435809 [details]
Revise the patch based on Simon's comment

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

>> Tools/WebKitTestRunner/Options.cpp:169
>> +    optionList.append(Option("--show-window", "Show the WebView during test runs (for debugging)", handleOptionShowWebView));
> 
> Why add the new option here instead of just passing --show-webview in the options? If we wanted to keep the option and name aligned, when creating the option, we could do this:
> 
> optparse.make_option('--show-window', '--show-webview', dest='show_webview', ...)
> 
> which would make the option inside webkitpy 'show_webview', but the option '--show-window' with an alias '--show-webview'

The original plan was to use `--show-window` instead of `--show-webview` in both run-webkit-tests and WebKitTestRunner , and Simon suggested to add an alias.
Comment 7 Alexey Proskuryakov 2021-08-18 17:01:26 PDT
I don't have a string opinion about which name to use, but having two options with identical descriptions is super confusing.

If you do this, please change the description to something like "DEPRECATED. Same as --show-window".
Comment 8 Peng Liu 2021-08-19 10:27:54 PDT
Created attachment 435880 [details]
Revise the patch based on Alexey's comment
Comment 9 Peng Liu 2021-08-19 11:41:36 PDT
Created attachment 435889 [details]
Fix build failures on the win bot
Comment 10 Peng Liu 2021-08-23 11:26:01 PDT
(In reply to Alexey Proskuryakov from comment #7)
> I don't have a string opinion about which name to use, but having two
> options with identical descriptions is super confusing.
> 
> If you do this, please change the description to something like "DEPRECATED.
> Same as --show-window".

Agree! Fixed.
Comment 11 EWS 2021-08-23 12:04:32 PDT
Committed r281461 (240840@main): <https://commits.webkit.org/240840@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 435889 [details].
Comment 12 Radar WebKit Bug Importer 2021-08-23 12:05:22 PDT
<rdar://problem/82255475>