Bug 221140

Summary: [LayoutTests] Convert http/tests/inspector/ convert PHP to Python
Product: WebKit Reporter: Chris Gambrell <cgambrell>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, ews-watchlist, hi, jbedard, 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
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
ews-feeder: commit-queue-
Patch
none
Patch none

Description Chris Gambrell 2021-01-29 09:44:26 PST
Replacing PHP with equivalent Python CGI scripts
Comment 1 Radar WebKit Bug Importer 2021-01-29 09:46:04 PST
<rdar://problem/73758592>
Comment 2 Chris Gambrell 2021-01-29 10:07:45 PST
Created attachment 418744 [details]
Patch
Comment 3 Chris Gambrell 2021-01-29 17:57:54 PST
Created attachment 418795 [details]
Patch
Comment 4 Chris Gambrell 2021-01-31 17:53:22 PST
Created attachment 418837 [details]
Patch
Comment 5 Chris Gambrell 2021-02-01 07:43:28 PST
Created attachment 418873 [details]
Patch
Comment 6 Chris Gambrell 2021-02-01 08:07:10 PST
Created attachment 418875 [details]
Patch
Comment 7 Chris Gambrell 2021-02-01 08:51:01 PST
Created attachment 418882 [details]
Patch
Comment 8 Chris Gambrell 2021-02-01 10:50:57 PST
Created attachment 418898 [details]
Patch
Comment 9 Chris Gambrell 2021-02-01 11:38:11 PST
Created attachment 418905 [details]
Patch
Comment 10 Chris Gambrell 2021-02-01 12:02:23 PST
Created attachment 418909 [details]
Patch
Comment 11 Chris Gambrell 2021-02-01 12:52:23 PST
Created attachment 418914 [details]
Patch
Comment 12 Chris Gambrell 2021-02-01 16:38:59 PST
Created attachment 418938 [details]
Patch
Comment 13 Chris Gambrell 2021-02-01 17:19:06 PST
Created attachment 418943 [details]
Patch
Comment 14 Chris Gambrell 2021-02-02 11:44:30 PST
Created attachment 419042 [details]
Patch
Comment 15 Chris Gambrell 2021-02-02 12:06:54 PST
Created attachment 419045 [details]
Patch
Comment 16 Jonathan Bedard 2021-02-02 12:43:00 PST
Comment on attachment 419045 [details]
Patch

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

Before we land this change, we need to ensure all ports are ok with the change and ensure that this works on our Windows ports.

> LayoutTests/http/tests/inspector/network/resources/basic-auth.py:9
> +expectedUsername = "goodUsername"

Lets standardize on single quotes

> LayoutTests/http/tests/inspector/network/resources/delay.py:16
> +time.sleep((delay * 1000) * 0.000001)

This should just be time.sleep(delay / 1000)

> LayoutTests/http/tests/inspector/network/resources/intercept-echo.py:21
> +ct = os.environ.get('CONTENT_TYPE')

Let's use a better variable than 'ct', perhaps 'content_type'?

> LayoutTests/http/tests/inspector/network/resources/intercept-echo.py:31
> +sys.stdout.write('    \"uri\": \"{}\",\n'.format(os.environ.get('REQUEST_URI')))

We shouldn't need to escape the "s in this string, since this string is using single quotes

> LayoutTests/http/tests/inspector/network/resources/json.py:7
> +sys.stdout.write('{\"version\": 1}')

We shouldn't need to escape the "s in this string, since this string is using single quotes
Comment 17 Chris Gambrell 2021-02-02 13:04:07 PST
Created attachment 419058 [details]
Patch
Comment 18 Jonathan Bedard 2021-02-02 13:11:25 PST
Comment on attachment 419058 [details]
Patch

Change looks good! We aren't quite ready to land yet, though. We need to make sure all ports can run Python cgi tests before landing.
Comment 19 Chris Gambrell 2021-02-08 15:22:15 PST
Created attachment 419644 [details]
Patch
Comment 20 Chris Gambrell 2021-02-08 16:03:41 PST
Some stylistic changes with multi-line sys.stdout.write's
Comment 21 Jonathan Bedard 2021-02-08 16:28:35 PST
Comment on attachment 419644 [details]
Patch

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

> LayoutTests/http/tests/inspector/network/resources/404.py:10
> +	'Content-Type: text/html\r\n'

We need to replace tabs with spaces, but other than that, looks good.
Comment 22 Chris Gambrell 2021-02-08 19:39:45 PST
Created attachment 419670 [details]
Patch
Comment 23 Chris Gambrell 2021-02-09 08:47:10 PST
Created attachment 419724 [details]
Patch
Comment 24 EWS 2021-02-09 09:36:15 PST
Committed r272582: <https://commits.webkit.org/r272582>

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