Skip to content
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

Merged
merged 1 commit into from
Aug 10, 2018

Conversation

jgraham
Copy link
Contributor

@jgraham jgraham commented Aug 9, 2018

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.

@foolip
Copy link
Member

foolip commented Aug 9, 2018

Can you add tests in /infrastructure/ that will fail in runners that don't load .serviceworker. over https? We'll need to import the wptserve change into Chromium and have a test fail if we don't would be sweet.

@jgraham
Copy link
Contributor Author

jgraham commented Aug 10, 2018

Added a test.

Copy link
Member

@gsnedders gsnedders left a 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?

@@ -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
Copy link
Member

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.)

@jgraham jgraham force-pushed the serviceworker_https branch from 79c83a2 to 0a15b98 Compare August 10, 2018 12:36
from ..sourcefile import SourceFile


class TestManifestItem(ManifestItem):
Copy link
Contributor

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?

@Ms2ger
Copy link
Contributor

Ms2ger commented Aug 10, 2018

And can you run infrastructure/server/secure-context.https.any.js on a service worker as well?

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.
@jgraham jgraham force-pushed the serviceworker_https branch from 0a15b98 to 7c3c1cd Compare August 10, 2018 13:51
@@ -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])
Copy link
Member

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?

Copy link
Contributor Author

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]: []

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, TIL. Please disregard :)

Copy link
Member

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. :)

@gsnedders
Copy link
Member

(not merging because Travis keeps failing because of ongoing network issues :/)

@jgraham jgraham merged commit bfec539 into master Aug 10, 2018
@gsnedders gsnedders deleted the serviceworker_https branch August 10, 2018 21:14
Hexcles added a commit to web-platform-tests/wpt.fyi that referenced this pull request Aug 14, 2018
Context: web-platform-tests/wpt#12381
.serviceworker. now implies .https.
Hexcles added a commit to web-platform-tests/wpt.fyi that referenced this pull request Aug 15, 2018
Context: web-platform-tests/wpt#12381
.serviceworker. now implies .https.
foolip added a commit that referenced this pull request Aug 19, 2018
The format itself hasn't changed, but incremental updating from
the current version doesn't work after #12381.

Fixes #12559.
jgraham pushed a commit that referenced this pull request Aug 20, 2018
The format itself hasn't changed, but incremental updating from
the current version doesn't work after #12381.

Fixes #12559.
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Aug 23, 2018
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
jankeromnes pushed a commit to jankeromnes/gecko that referenced this pull request Aug 23, 2018
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
zcorpan pushed a commit that referenced this pull request Aug 27, 2018
The format itself hasn't changed, but incremental updating from
the current version doesn't work after #12381.

Fixes #12559.
aarongable pushed a commit to chromium/chromium that referenced this pull request Aug 31, 2018
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}
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 3, 2019
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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 3, 2019
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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 3, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants