Bug 221511 - [LayoutTests] Convert http/tests/css convert PHP to Python
Summary: [LayoutTests] Convert http/tests/css convert PHP to Python
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-05 18:04 PST by Chris Gambrell
Modified: 2021-02-10 08:53 PST (History)
6 users (show)

See Also:


Attachments
Patch (7.31 KB, patch)
2021-02-09 16:12 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (7.32 KB, patch)
2021-02-09 17:35 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (7.19 KB, patch)
2021-02-09 17:45 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (7.35 KB, patch)
2021-02-09 17:59 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (7.19 KB, patch)
2021-02-09 18:03 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Gambrell 2021-02-05 18:04:06 PST
Replacing PHP with equivalent Python CGI scripts
Comment 1 Radar WebKit Bug Importer 2021-02-05 18:05:26 PST
<rdar://problem/74049585>
Comment 2 Chris Gambrell 2021-02-09 16:12:33 PST
Created attachment 419782 [details]
Patch
Comment 3 Jonathan Bedard 2021-02-09 17:07:48 PST
Comment on attachment 419782 [details]
Patch

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

> LayoutTests/http/tests/css/resources/500.py:9
> +    'HTTP/1.0 500 Internal Error\r\n'

Shouldn't this just be: 'status: 500\r\n'?

> LayoutTests/http/tests/css/resources/webfont-request.py:21
> +sys.path.insert(0, http_root)

Does not look like we actually need this, since you aren't using any shared code

> LayoutTests/http/tests/css/resources/webfont-request.py:37
> +        'Content-Type: application/octet-stream\r\n\r\n'

"echo" results in a newline, so we should add a \n to this string

> LayoutTests/http/tests/css/resources/webfont-request.py:44
> +        '{}'.format(currentCount)

"echo" results in a newline, so we should add a \n to this string
Comment 4 Chris Gambrell 2021-02-09 17:35:40 PST
Created attachment 419796 [details]
Patch
Comment 5 Chris Gambrell 2021-02-09 17:45:14 PST
Created attachment 419798 [details]
Patch
Comment 6 Chris Gambrell 2021-02-09 17:59:40 PST
Created attachment 419799 [details]
Patch
Comment 7 Chris Gambrell 2021-02-09 18:03:15 PST
Created attachment 419800 [details]
Patch
Comment 8 Chris Gambrell 2021-02-09 18:04:16 PST
(In reply to Jonathan Bedard from comment #3)
> Comment on attachment 419782 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=419782&action=review
> 
> > LayoutTests/http/tests/css/resources/500.py:9
> > +    'HTTP/1.0 500 Internal Error\r\n'
> 
> Shouldn't this just be: 'status: 500\r\n'?
> 

Changed the header to match correct python style


> > LayoutTests/http/tests/css/resources/webfont-request.py:21
> > +sys.path.insert(0, http_root)
> 
> Does not look like we actually need this, since you aren't using any shared
> code
> 

Removed 3 unused lines


> > LayoutTests/http/tests/css/resources/webfont-request.py:37
> > +        'Content-Type: application/octet-stream\r\n\r\n'
> 
> "echo" results in a newline, so we should add a \n to this string
> 

Found out that PHP's echo doesn't add a new line, must be the print func


> > LayoutTests/http/tests/css/resources/webfont-request.py:44
> > +        '{}'.format(currentCount)
> 
> "echo" results in a newline, so we should add a \n to this string
> 

Found out that PHP's echo doesn't add a new line, must be the print func
Comment 9 EWS 2021-02-10 08:53:17 PST
Committed r272656: <https://commits.webkit.org/r272656>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 419800 [details].