Bug 221286

Summary: [LayoutTests] Convert http/tests/appcache 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, 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
https://bugs.webkit.org/show_bug.cgi?id=224054
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
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
ews-feeder: commit-queue-
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

Description Chris Gambrell 2021-02-02 12:46:04 PST
Replacing PHP with equivalent Python CGI scripts
Comment 1 Radar WebKit Bug Importer 2021-02-02 12:47:50 PST
<rdar://problem/73893844>
Comment 2 Chris Gambrell 2021-02-02 14:07:15 PST
Created attachment 419063 [details]
Patch
Comment 3 Chris Gambrell 2021-02-02 14:21:42 PST
Created attachment 419064 [details]
Patch
Comment 4 Alexey Proskuryakov 2021-02-02 14:50:03 PST
Comment on attachment 419064 [details]
Patch

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

> LayoutTests/http/tests/appcache/resources/slow-resource.py:7
> +time.sleep(1 / 100000)

Why does this use 1 / 100000? I thought that the argument was seconds for both PHP and Python.
Comment 5 Chris Gambrell 2021-02-02 17:04:06 PST
(In reply to Alexey Proskuryakov from comment #4)
> Comment on attachment 419064 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=419064&action=review
> 
> > LayoutTests/http/tests/appcache/resources/slow-resource.py:7
> > +time.sleep(1 / 100000)
> 
> Why does this use 1 / 100000? I thought that the argument was seconds for
> both PHP and Python.

You are correct. I must have accidentally had the 'usleep' documentation pulled up instead of the 'sleep' for PHP. Will fix this in the next patch I push.
Comment 6 Chris Gambrell 2021-02-02 17:29:23 PST
Created attachment 419088 [details]
Patch
Comment 7 Chris Gambrell 2021-02-02 18:08:00 PST
(In reply to Chris Gambrell from comment #6)
> Created attachment 419088 [details]
> Patch

Failed mac-wk1, mac-wb2. identifier-test.py incorrectly sent status
Comment 8 Chris Gambrell 2021-02-02 18:11:32 PST
Created attachment 419091 [details]
Patch
Comment 9 Chris Gambrell 2021-02-02 18:22:22 PST
Created attachment 419092 [details]
Patch
Comment 10 Chris Gambrell 2021-02-02 18:46:57 PST
Created attachment 419093 [details]
Patch
Comment 11 Chris Gambrell 2021-02-03 08:33:02 PST
Created attachment 419140 [details]
Patch
Comment 12 Chris Gambrell 2021-02-03 09:49:14 PST
Created attachment 419150 [details]
Patch
Comment 13 Chris Gambrell 2021-02-03 11:07:47 PST
Created attachment 419158 [details]
Patch
Comment 14 Chris Gambrell 2021-02-03 14:30:12 PST
Created attachment 419186 [details]
Patch
Comment 15 Chris Gambrell 2021-02-03 15:45:50 PST
Created attachment 419197 [details]
Patch
Comment 16 Chris Gambrell 2021-02-03 16:55:45 PST
Created attachment 419207 [details]
Patch
Comment 17 Chris Gambrell 2021-02-04 07:28:06 PST
Created attachment 419281 [details]
Patch
Comment 18 Chris Gambrell 2021-02-04 09:45:07 PST
Created attachment 419292 [details]
Patch
Comment 19 Chris Gambrell 2021-02-04 11:41:45 PST
Created attachment 419304 [details]
Patch
Comment 20 Chris Gambrell 2021-02-04 14:16:57 PST
Created attachment 419319 [details]
Patch
Comment 21 Chris Gambrell 2021-02-04 14:51:49 PST
Created attachment 419326 [details]
Patch
Comment 22 Chris Gambrell 2021-02-04 15:28:20 PST
Created attachment 419330 [details]
Patch
Comment 23 Chris Gambrell 2021-02-04 18:07:21 PST
Created attachment 419349 [details]
Patch
Comment 24 Chris Gambrell 2021-02-04 18:56:55 PST
Created attachment 419353 [details]
Patch
Comment 25 Chris Gambrell 2021-02-04 19:47:32 PST
Created attachment 419356 [details]
Patch
Comment 26 Chris Gambrell 2021-02-05 06:51:41 PST
Created attachment 419398 [details]
Patch
Comment 27 Chris Gambrell 2021-02-05 09:46:33 PST
Created attachment 419419 [details]
Patch
Comment 28 Chris Gambrell 2021-02-05 10:54:15 PST
Created attachment 419435 [details]
Patch
Comment 29 Chris Gambrell 2021-02-05 12:29:28 PST
Created attachment 419446 [details]
Patch
Comment 30 Chris Gambrell 2021-02-05 12:49:29 PST
Created attachment 419448 [details]
Patch
Comment 31 Chris Gambrell 2021-02-05 13:50:19 PST
Created attachment 419458 [details]
Patch
Comment 32 Chris Gambrell 2021-02-05 15:04:47 PST
Created attachment 419472 [details]
Patch
Comment 33 Chris Gambrell 2021-02-05 16:06:59 PST
Created attachment 419479 [details]
Patch
Comment 34 Chris Gambrell 2021-02-05 17:01:02 PST
Created attachment 419484 [details]
Patch
Comment 35 Chris Gambrell 2021-02-05 17:30:58 PST
Created attachment 419486 [details]
Patch
Comment 36 Chris Gambrell 2021-03-23 13:02:58 PDT
Created attachment 424052 [details]
Patch
Comment 37 Chris Gambrell 2021-03-23 14:16:08 PDT
Created attachment 424065 [details]
Patch
Comment 38 Chris Gambrell 2021-03-23 19:33:36 PDT
Created attachment 424092 [details]
Patch
Comment 39 Chris Gambrell 2021-03-23 22:23:05 PDT
Created attachment 424097 [details]
Patch
Comment 40 Chris Gambrell 2021-03-23 22:25:47 PDT
Comment on attachment 424097 [details]
Patch

http/tests/appcache/resources/manifest-protected-script.php was not used and removed from the directory
Comment 41 Jonathan Bedard 2021-03-24 12:25:26 PDT
Comment on attachment 424097 [details]
Patch

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

> LayoutTests/http/tests/appcache/resources/fail-on-update-2.py:9
> +http_root = os.path.dirname(os.path.dirname(os.path.abspath(os.path.dirname(file))))

I don't see us using this, although maybe we should leverage the getState/setState in http/tests/resources/portabilityLayer.py instead of duplicating it.

> LayoutTests/http/tests/appcache/resources/fail-on-update.py:11
> +http_root = os.path.dirname(os.path.dirname(os.path.abspath(os.path.dirname(file))))

I don't see us using this, although maybe we should leverage the getState/setState in http/tests/resources/portabilityLayer.py instead of duplicating it.

> LayoutTests/http/tests/appcache/resources/online-allowlist.py:10
> +http_root = os.path.dirname(os.path.dirname(os.path.abspath(os.path.dirname(file))))

I don't see us using this.

> LayoutTests/http/tests/appcache/resources/remove-cache.py:11
> +http_root = os.path.dirname(os.path.dirname(os.path.abspath(os.path.dirname(file))))

I don't see us using this, although maybe we should leverage the getState/setState in http/tests/resources/portabilityLayer.py instead of duplicating it.

> LayoutTests/http/tests/appcache/resources/update-cache.py:11
> +http_root = os.path.dirname(os.path.dirname(os.path.abspath(os.path.dirname(file))))

I don't see us using this, although the "step_counter" hear looks pretty similar to the one used in another file in this change.
Comment 42 Chris Gambrell 2021-03-31 09:46:30 PDT
Created attachment 424779 [details]
Patch
Comment 43 Chris Gambrell 2021-03-31 09:48:45 PDT
Comment on attachment 424779 [details]
Patch

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

> LayoutTests/ChangeLog:70
> +        * http/tests/appcache/resources/manifest-protected-script.php: Removed.

File not used by any tests

> LayoutTests/http/tests/appcache/404-resource-with-slow-main-resource.php:-1
> -<!-- webkit-test-runner [ dumpJSConsoleLogInStdErr=true ] -->

Moved to LayoutTests/TestExpectations

> LayoutTests/http/tests/appcache/fail-on-update-2.html:-1
> -<!-- webkit-test-runner [ dumpJSConsoleLogInStdErr=true ] -->

Moved to LayoutTests/TestExpectations

> LayoutTests/http/tests/appcache/fail-on-update.html:-1
> -<!-- webkit-test-runner [ dumpJSConsoleLogInStdErr=true ] -->

Moved to LayoutTests/TestExpectations
Comment 44 Jonathan Bedard 2021-03-31 14:02:49 PDT
Comment on attachment 424779 [details]
Patch

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

> LayoutTests/http/tests/appcache/resources/cookie-protected-script.py:13
> +        cookies[cookie[0]] = cookie[1]

You're about to land get_cookies in https://bugs.webkit.org/show_bug.cgi?id=223891, no?

> LayoutTests/http/tests/appcache/resources/fail-on-update.py:13
> +def set_state(new_state, file):

Seems like we should be using from resources.portabilityLayer import set_state here

> LayoutTests/http/tests/appcache/resources/fallback-redirect.py:10
> +    'Content-Type: text/html\r\n\r\n'

No 307?

> LayoutTests/http/tests/appcache/resources/manifest-if-cookie.py:13
> +        cookies[cookie[0]] = cookie[1]

You're about to land get_cookies in https://bugs.webkit.org/show_bug.cgi?id=223891, no?

> LayoutTests/http/tests/appcache/resources/online-allowlist.py:10
> +http_root = os.path.dirname(os.path.dirname(os.path.abspath(os.path.dirname(file))))

Doesn't look like we're using this

> LayoutTests/http/tests/appcache/resources/remove-cache.py:13
> +def set_state(new_state, file):

Seems like we should be using from resources.portabilityLayer import set_state here

> LayoutTests/http/tests/appcache/resources/update-cache.py:11
> +http_root = os.path.dirname(os.path.dirname(os.path.abspath(os.path.dirname(file))))

Doesn't look like we are using this.

> LayoutTests/http/tests/appcache/resources/scope1/cookie-protected-manifest.py:13
> +        cookies[cookie[0]] = cookie[1]

Consider using the shared get_cookie function you are about to land.

> LayoutTests/http/tests/appcache/resources/scope2/cookie-protected-script.py:13
> +        cookies[cookie[0]] = cookie[1]

Consider using the shared get_cookie function you are about to land
Comment 45 Chris Gambrell 2021-03-31 17:14:27 PDT
Created attachment 424845 [details]
Patch
Comment 46 EWS 2021-03-31 18:16:56 PDT
Committed r275332: <https://commits.webkit.org/r275332>

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