Bug 222418

Summary: [LayoutTests] Convert http/tests/navigation convert PHP to Python
Product: WebKit Reporter: Chris Gambrell <cgambrell>
Component: Tools / TestsAssignee: Chris Gambrell <cgambrell>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, ews-watchlist, hi, jbedard, mkwst, ryanhaddad, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=220749
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch jbedard: review+

Chris Gambrell
Reported 2021-02-25 08:07:27 PST
Replacing PHP with equivalent Python CGI scripts
Attachments
Patch (75.10 KB, patch)
2021-02-25 08:11 PST, Chris Gambrell
no flags
Patch (106.72 KB, patch)
2021-03-01 15:24 PST, Chris Gambrell
no flags
Patch (102.42 KB, patch)
2021-03-01 15:35 PST, Chris Gambrell
no flags
Patch (98.70 KB, patch)
2021-03-01 15:46 PST, Chris Gambrell
no flags
Patch (93.55 KB, patch)
2021-03-01 16:31 PST, Chris Gambrell
no flags
Patch (123.56 KB, patch)
2021-03-01 17:18 PST, Chris Gambrell
no flags
Patch (121.51 KB, patch)
2021-03-02 14:18 PST, Chris Gambrell
no flags
Patch (66.18 KB, patch)
2021-04-05 10:00 PDT, Chris Gambrell
no flags
Patch (55.04 KB, patch)
2021-04-05 11:03 PDT, Chris Gambrell
no flags
Patch (54.44 KB, patch)
2021-04-08 12:39 PDT, Chris Gambrell
jbedard: review+
Radar WebKit Bug Importer
Comment 1 2021-02-25 08:07:44 PST
Chris Gambrell
Comment 2 2021-02-25 08:11:55 PST
Chris Gambrell
Comment 3 2021-03-01 15:24:22 PST
Chris Gambrell
Comment 4 2021-03-01 15:35:18 PST
Chris Gambrell
Comment 5 2021-03-01 15:46:00 PST
Chris Gambrell
Comment 6 2021-03-01 16:31:43 PST
Chris Gambrell
Comment 7 2021-03-01 17:18:33 PST
Jonathan Bedard
Comment 8 2021-03-02 11:36:33 PST
Comment on attachment 421891 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=421891&action=review > LayoutTests/http/tests/navigation/post-redirect-get-reload.py:15 > +else: Can we do an early exit instead of an else here? > LayoutTests/http/tests/navigation/resources/redirect-on-back-updates-history-item.py:27 > + sys.stdout.write( Can we do an early exit instead of else here? > LayoutTests/http/tests/navigation/resources/redirect-on-reload-updates-history-item.py:63 > + ) Nit: Extra whitespace here > LayoutTests/http/tests/navigation/resources/randomredirects/0.py:10 > + headers[headername[4:].lower().replace('_', '-')] = headervalue This should be '5:' I think this will be easier if you just check the environment for 'HTTP_IF_MODIFIED_SINCE' in line 12 and ditch this loop entirely. > LayoutTests/http/tests/navigation/resources/randomredirects/1.py:10 > + headers[headername[4:].lower().replace('_', '-')] = headervalue Ditto. > LayoutTests/http/tests/navigation/resources/randomredirects/2.py:10 > + headers[headername[4:].lower().replace('_', '-')] = headervalue Ditto. > LayoutTests/http/tests/navigation/resources/randomredirects/3.py:10 > + headers[headername[4:].lower().replace('_', '-')] = headervalue Ditto. > LayoutTests/http/tests/navigation/resources/randomredirects/4.py:10 > + headers[headername[4:].lower().replace('_', '-')] = headervalue Ditto. > LayoutTests/http/tests/navigation/resources/randomredirects/5.py:10 > + headers[headername[4:].lower().replace('_', '-')] = headervalue Ditto. > LayoutTests/http/tests/navigation/resources/randomredirects/6.py:10 > + headers[headername[4:].lower().replace('_', '-')] = headervalue Ditto. > LayoutTests/http/tests/navigation/resources/randomredirects/7.py:10 > + headers[headername[4:].lower().replace('_', '-')] = headervalue Ditto. > LayoutTests/http/tests/navigation/resources/randomredirects/8.py:10 > + headers[headername[4:].lower().replace('_', '-')] = headervalue Ditto. > LayoutTests/http/tests/navigation/resources/randomredirects/9.py:10 > + headers[headername[4:].lower().replace('_', '-')] = headervalue Ditto.
Chris Gambrell
Comment 9 2021-03-02 14:18:07 PST
EWS
Comment 10 2021-03-02 18:20:56 PST
Committed r273781: <https://commits.webkit.org/r273781> All reviewed patches have been landed. Closing bug and clearing flags on attachment 421997 [details].
Chris Gambrell
Comment 11 2021-04-05 09:51:40 PDT
Reopening for second pass at .php files
Chris Gambrell
Comment 12 2021-04-05 10:00:18 PDT
Chris Gambrell
Comment 13 2021-04-05 11:03:37 PDT
Chris Gambrell
Comment 14 2021-04-05 11:07:18 PDT
Comment on attachment 425174 [details] Patch There were issues with apply-patch and the files * LayoutTests/http/tests/navigation/no-referrer-reset.html * LayoutTests/http/tests/navigation/no-referrer-same-window.html * LayoutTests/http/tests/navigation/no-referrer-subframe.html * LayoutTests/http/tests/navigation/no-referrer-target-blank.html which contains the new py files * LayoutTests/http/tests/navigation/resources/no-referrer-reset-helper.py * LayoutTests/http/tests/navigation/resources/no-referrer-same-window-helper.py * LayoutTests/http/tests/navigation/resources/no-referrer-helper.py Reverted the tests for now back to the original with the .php versions of the scripts but also included the .py files for review. macwk1, macwk2, and iOS all pass locally on my machine with the new py versions. Once r+ I will change the tests back to the .py versions and remove the .php files to keep apply-patch happy.
Jonathan Bedard
Comment 15 2021-04-08 11:27:18 PDT
Comment on attachment 425174 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=425174&action=review > LayoutTests/http/tests/navigation/resources/check-ping.py:10 > +sys.path.insert(0, http_root) I don't see us using this. > LayoutTests/http/tests/navigation/resources/delete-ping.py:9 > +sys.path.insert(0, http_root) I don't see us using this. > LayoutTests/http/tests/navigation/resources/no-referrer-helper.py:1 > +#!/usr/bin/env python3 Are we still using http/tests/navigation/resources/no-referrer-helper.php? > LayoutTests/http/tests/navigation/resources/no-referrer-reset-helper.py:1 > +#!/usr/bin/env python3 Are we still using http/tests/navigation/resources/no-referrer-reset-helper.php? > LayoutTests/http/tests/navigation/resources/no-referrer-same-window-helper.py:1 > +#!/usr/bin/env python3 Are we still using http/tests/navigation/resources/no-referrer-same-window-helper.php? > LayoutTests/http/tests/navigation/resources/ping_file_path.py:10 > +sys.path.insert(0, http_root) I don't see us using this. > LayoutTests/http/tests/navigation/resources/redirected-post-request-contents.py:40 > +if content is not None and content == 'true': Can just do "content == 'true'"
Chris Gambrell
Comment 16 2021-04-08 12:39:20 PDT
Chris Gambrell
Comment 17 2021-04-08 12:40:23 PDT
(In reply to Jonathan Bedard from comment #15) > Comment on attachment 425174 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=425174&action=review > > > LayoutTests/http/tests/navigation/resources/check-ping.py:10 > > +sys.path.insert(0, http_root) > > I don't see us using this. > > > LayoutTests/http/tests/navigation/resources/delete-ping.py:9 > > +sys.path.insert(0, http_root) > > I don't see us using this. > > > LayoutTests/http/tests/navigation/resources/no-referrer-helper.py:1 > > +#!/usr/bin/env python3 > > Are we still using http/tests/navigation/resources/no-referrer-helper.php? > > > LayoutTests/http/tests/navigation/resources/no-referrer-reset-helper.py:1 > > +#!/usr/bin/env python3 > > Are we still using > http/tests/navigation/resources/no-referrer-reset-helper.php? > > > LayoutTests/http/tests/navigation/resources/no-referrer-same-window-helper.py:1 > > +#!/usr/bin/env python3 > > Are we still using > http/tests/navigation/resources/no-referrer-same-window-helper.php? > > > LayoutTests/http/tests/navigation/resources/ping_file_path.py:10 > > +sys.path.insert(0, http_root) > > I don't see us using this. > > > LayoutTests/http/tests/navigation/resources/redirected-post-request-contents.py:40 > > +if content is not None and content == 'true': > > Can just do "content == 'true'" See comment 14 for why some PHP have not yet been removed
Chris Gambrell
Comment 18 2021-04-08 14:27:48 PDT
Note You need to log in before you can comment on or make changes to this bug.