Bug 221286 - [LayoutTests] Convert http/tests/appcache convert PHP to Python
Summary: [LayoutTests] Convert http/tests/appcache 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: Chris Gambrell
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-02 12:46 PST by Chris Gambrell
Modified: 2021-04-01 09:52 PDT (History)
6 users (show)

See Also:


Attachments
Patch (8.39 KB, patch)
2021-02-02 14:07 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (9.20 KB, patch)
2021-02-02 14:21 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (7.71 KB, patch)
2021-02-02 17:29 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (12.76 KB, patch)
2021-02-02 18:11 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (15.81 KB, patch)
2021-02-02 18:22 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (22.34 KB, patch)
2021-02-02 18:46 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (23.36 KB, patch)
2021-02-03 08:33 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (26.93 KB, patch)
2021-02-03 09:49 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (29.26 KB, patch)
2021-02-03 11:07 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (41.57 KB, patch)
2021-02-03 14:30 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (48.33 KB, patch)
2021-02-03 15:45 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (54.60 KB, patch)
2021-02-03 16:55 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (55.44 KB, patch)
2021-02-04 07:28 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (70.68 KB, patch)
2021-02-04 09:45 PST, Chris Gambrell
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (79.62 KB, patch)
2021-02-04 11:41 PST, Chris Gambrell
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (14.54 KB, patch)
2021-02-04 14:16 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (15.08 KB, patch)
2021-02-04 14:51 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (24.94 KB, patch)
2021-02-04 15:28 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (37.79 KB, patch)
2021-02-04 18:07 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (58.98 KB, patch)
2021-02-04 18:56 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (55.48 KB, patch)
2021-02-04 19:47 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (58.84 KB, patch)
2021-02-05 06:51 PST, Chris Gambrell
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (59.33 KB, patch)
2021-02-05 09:46 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (60.32 KB, patch)
2021-02-05 10:54 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (59.21 KB, patch)
2021-02-05 12:29 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (66.31 KB, patch)
2021-02-05 12:49 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (66.36 KB, patch)
2021-02-05 13:50 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (93.61 KB, patch)
2021-02-05 15:04 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (89.35 KB, patch)
2021-02-05 16:06 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (87.45 KB, patch)
2021-02-05 17:01 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (88.13 KB, patch)
2021-02-05 17:30 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (23.23 KB, patch)
2021-03-23 13:02 PDT, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (42.88 KB, patch)
2021-03-23 14:16 PDT, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (64.71 KB, patch)
2021-03-23 19:33 PDT, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (86.20 KB, patch)
2021-03-23 22:23 PDT, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (105.48 KB, patch)
2021-03-31 09:46 PDT, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (105.02 KB, patch)
2021-03-31 17:14 PDT, 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-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].