-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix service worker tests generated from non-https .any.js #12381
Conversation
Can you add tests in /infrastructure/ that will fail in runners that don't load |
2b3f0e6
to
79c83a2
Compare
Added a test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some unit test for this as well? Checking URLManifestItem has the expected behaviour?
tools/manifest/item.py
Outdated
@@ -46,14 +46,19 @@ def id(self): | |||
"""The test's id (usually its url)""" | |||
pass | |||
|
|||
@property | |||
def meta_flags(self): | |||
return self.source_file.meta_flags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this logically not be a set rather than a list? (I realise it currently isn't, and I'm not gonna block this PR on that.)
79c83a2
to
0a15b98
Compare
tools/manifest/tests/test_item.py
Outdated
from ..sourcefile import SourceFile | ||
|
||
|
||
class TestManifestItem(ManifestItem): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use SupportFile
instead of a mock object?
And can you run |
Note: this contains a change to the expected behaviour of test runners. Previously .any.js tests specifying a serviceworker variant generated a url like foo.https.any.serviceworker.html. But that causes a problem because that looks exctly like a url generated from a file named foo.https.js. This ambiguity, together with the fact that wptrunner wasn't actually looking at the https flag in the test id, but only in the filename, meant that service worker tests weren't being run properly. This change stops adding .https. to serviceworker tests generated from .any.js files and instead makes .serviceworker. in the test id directly mean that the test should be loaded over https.
0a15b98
to
7c3c1cd
Compare
@@ -95,6 +100,10 @@ def __init__(self, source_file, url, url_base="/", manifest=None): | |||
def id(self): | |||
return self.url | |||
|
|||
@property | |||
def meta_flags(self): | |||
return set(urlparse(self.url).path.rsplit("/", 1)[1].split(".")[1:-1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any guarantee that the test name in URL will always have at least a dot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't matter.
In [1]: "abc".split(".")[1:-1]
Out[1]: []
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, TIL. Please disregard :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slices work differently to indexes. :)
(not merging because Travis keeps failing because of ongoing network issues :/) |
Context: web-platform-tests/wpt#12381 .serviceworker. now implies .https.
Context: web-platform-tests/wpt#12381 .serviceworker. now implies .https.
Automatic update from web-platform-testsBump the manifest version to 5 (#12563) The format itself hasn't changed, but incremental updating from the current version doesn't work after web-platform-tests/wpt#12381. Fixes web-platform-tests/wpt#12559. -- wpt-commits: 052d3a71637062a4ecf7266aa138ccdc8ae2c983 wpt-pr: 12563
Automatic update from web-platform-testsBump the manifest version to 5 (#12563) The format itself hasn't changed, but incremental updating from the current version doesn't work after web-platform-tests/wpt#12381. Fixes web-platform-tests/wpt#12559. -- wpt-commits: 052d3a71637062a4ecf7266aa138ccdc8ae2c983 wpt-pr: 12563
Mainly for the .serviceworker. change in tools/manifest/item.py, from web-platform-tests/wpt#12381 port/driver.py is updated accordingly to match upstream wptrunner to use HTTPS for .serviceworker. tests. This fixes an infrastructure/ test. Multiple other .serviceworker. tests are also rebaselined. There have been two recent manifest changes: web-platform-tests/wpt#12182 web-platform-tests/wpt#12563 (version bump) In order to not require a full manifest rebuild once this lands, WPT_BASE_MANIFEST.json needs to be updated. However, updating it in place has proven very difficult due to the size of the resulting diff. Instead, a WPT_BASE_MANIFEST_5.json is created. The old one will be deleted separately. Related Gerrit bug: https://bugs.chromium.org/p/gerrit/issues/detail?id=9640 This also brings in HTTP/2.0 support from web-platform-tests/wpt#12193. For this, new third_party python code is needed, namely h2, hpack, hyperframe, and enum. In addition to adding those to WPTWhiteList, it is also sorted and lines which aren't existing files (i.e., directories and removed files) are dropped. Reviewed at https://chromium-review.googlesource.com/1183425 but size of CL causing trouble updating it on Gerrit. [email protected] Bug: 876717 Change-Id: Ia43bd2eca54883a5d72a48008b6677d0e7187056 Reviewed-on: https://chromium-review.googlesource.com/1196424 Reviewed-by: Robert Ma <[email protected]> Reviewed-by: Philip Jägenstedt <[email protected]> Commit-Queue: Philip Jägenstedt <[email protected]> Cr-Commit-Position: refs/heads/master@{#588057}
Automatic update from web-platform-testsBump the manifest version to 5 (#12563) The format itself hasn't changed, but incremental updating from the current version doesn't work after web-platform-tests/wpt#12381. Fixes web-platform-tests/wpt#12559. -- wpt-commits: 052d3a71637062a4ecf7266aa138ccdc8ae2c983 wpt-pr: 12563 UltraBlame original commit: ef3bbe29c33d91e65e992657f56cc86dd223f749
Automatic update from web-platform-testsBump the manifest version to 5 (#12563) The format itself hasn't changed, but incremental updating from the current version doesn't work after web-platform-tests/wpt#12381. Fixes web-platform-tests/wpt#12559. -- wpt-commits: 052d3a71637062a4ecf7266aa138ccdc8ae2c983 wpt-pr: 12563 UltraBlame original commit: ef3bbe29c33d91e65e992657f56cc86dd223f749
Automatic update from web-platform-testsBump the manifest version to 5 (#12563) The format itself hasn't changed, but incremental updating from the current version doesn't work after web-platform-tests/wpt#12381. Fixes web-platform-tests/wpt#12559. -- wpt-commits: 052d3a71637062a4ecf7266aa138ccdc8ae2c983 wpt-pr: 12563 UltraBlame original commit: ef3bbe29c33d91e65e992657f56cc86dd223f749
Note: this contains a change to the expected behaviour of test
runners.
Previously .any.js tests specifying a serviceworker variant generated
a url like foo.https.any.serviceworker.html. But that causes a problem
because that looks exctly like a url generated from a file named
foo.https.js. This ambiguity, together with the fact that wptrunner
wasn't actually looking at the https flag in the test id, but only in
the filename, meant that service worker tests weren't being run
properly.
This change stops adding .https. to serviceworker tests generated from
.any.js files and instead makes .serviceworker. in the test id
directly mean that the test should be loaded over https.