WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
224622
[LayoutTests] Convert http/tests/resources convert PHP to Python
https://bugs.webkit.org/show_bug.cgi?id=224622
Summary
[LayoutTests] Convert http/tests/resources convert PHP to Python
Chris Gambrell
Reported
2021-04-15 13:55:40 PDT
Replacing PHP with equivalent Python CGI scripts
Attachments
Patch
(137.55 KB, patch)
2021-04-15 14:08 PDT
,
Chris Gambrell
no flags
Details
Formatted Diff
Diff
Patch
(142.08 KB, patch)
2021-04-15 15:47 PDT
,
Chris Gambrell
no flags
Details
Formatted Diff
Diff
Patch
(142.76 KB, patch)
2021-04-16 09:30 PDT
,
Chris Gambrell
no flags
Details
Formatted Diff
Diff
Patch
(142.83 KB, patch)
2021-04-19 11:31 PDT
,
Chris Gambrell
no flags
Details
Formatted Diff
Diff
Patch
(142.91 KB, patch)
2021-04-19 17:26 PDT
,
Chris Gambrell
no flags
Details
Formatted Diff
Diff
Patch
(142.40 KB, patch)
2021-04-20 11:24 PDT
,
Chris Gambrell
no flags
Details
Formatted Diff
Diff
Patch
(139.42 KB, patch)
2021-04-22 08:30 PDT
,
Chris Gambrell
no flags
Details
Formatted Diff
Diff
Show Obsolete
(6)
View All
Add attachment
proposed patch, testcase, etc.
Chris Gambrell
Comment 1
2021-04-15 14:08:30 PDT
Created
attachment 426136
[details]
Patch
Chris Gambrell
Comment 2
2021-04-15 15:47:16 PDT
Created
attachment 426145
[details]
Patch
Ryan Haddad
Comment 3
2021-04-15 15:51:06 PDT
rdar://76727052
Chris Gambrell
Comment 4
2021-04-16 09:30:51 PDT
Created
attachment 426237
[details]
Patch
Chris Gambrell
Comment 5
2021-04-19 11:31:14 PDT
Created
attachment 426448
[details]
Patch
Chris Gambrell
Comment 6
2021-04-19 11:34:01 PDT
Comment on
attachment 426448
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=426448&action=review
> LayoutTests/http/tests/resources/last-modified.py:8 > +date = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True).get('date', [datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT')])[0]
Python will not send the 'Last-Modified' header if it is empty or an invalid date format. Adding this as the default protects against an empty date
Jonathan Bedard
Comment 7
2021-04-19 11:39:55 PDT
(In reply to Chris Gambrell from
comment #6
)
> Comment on
attachment 426448
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=426448&action=review
> > > LayoutTests/http/tests/resources/last-modified.py:8 > > +date = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True).get('date', [datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT')])[0] > > Python will not send the 'Last-Modified' header if it is empty or an invalid > date format. Adding this as the default protects against an empty date
More accurately, Apache will not send the Last-Modified header if Python prints an empty or invalid header.
Chris Gambrell
Comment 8
2021-04-19 17:26:49 PDT
Created
attachment 426496
[details]
Patch
Jonathan Bedard
Comment 9
2021-04-20 09:15:13 PDT
Comment on
attachment 426496
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=426496&action=review
> LayoutTests/http/tests/misc/last-modified-parsing.html:17 > +test('Mon, 03 Mar 2008 01:03:33 GMT');
...which port was this required to fix? Looking at the test name, I think we're meaningfully changing the behavior of this test.
> LayoutTests/http/tests/resources/portabilityLayer.py:82 > +def set_state(file, state):
This has big implications for all of this function's callers. What motivated the change?
> LayoutTests/http/tests/resources/reset-temp-file.py:7 > +filename = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True).get('filename', ['404.txt'])[0]
Why did we change the name of the default file?
> LayoutTests/http/tests/resources/touch-temp-file.py:8 > +filename = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True).get('filename', ['404.txt'])[0]
Why did we change the name of the default file?
Chris Gambrell
Comment 10
2021-04-20 11:24:46 PDT
Created
attachment 426573
[details]
Patch
Chris Gambrell
Comment 11
2021-04-20 11:27:27 PDT
Comment on
attachment 426573
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=426573&action=review
> LayoutTests/http/tests/misc/last-modified-parsing.html:8 > + document.write('<iframe src="../resources/last-modified.py?date=' + escape(text) + '"></iframe>');
Reverted to keep different formats of dates in this test
> LayoutTests/http/tests/resources/last-modified.py:14 > +else:
Re-format date if it isn't in an appropriate format for Last-Modified header.
> LayoutTests/http/tests/resources/portabilityLayer.py:82 > +def set_state(file, state):
Moved file to first arg to keep consistent with all other functions in this script. Addressed every instance of a caller of this function and made sure they were all changed to match the argument order.
Chris Gambrell
Comment 12
2021-04-22 08:30:18 PDT
Created
attachment 426813
[details]
Patch
Chris Gambrell
Comment 13
2021-04-26 10:20:40 PDT
http/tests/images/mp4-partial-load.html is failing mac-wk2-stress. When running the same test with its PHP version instead of Python, it is failing the same way. There is a separate issue with this test and a separate bug will be created to fix it.
EWS
Comment 14
2021-04-26 10:45:15 PDT
Committed
r276602
(
237034@main
): <
https://commits.webkit.org/237034@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 426813
[details]
.
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