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

Web Platform Tests Checkout #87

Merged
merged 2 commits into from
Oct 25, 2024
Merged

Web Platform Tests Checkout #87

merged 2 commits into from
Oct 25, 2024

Conversation

olegbespalov
Copy link
Contributor

@olegbespalov olegbespalov commented Oct 25, 2024

What?

This PR implements running of the web platform tests not against static in-repository files, but it does check out to the latest proven to commit, apply patches with k6/web crypto implementation specific, and runs test against it.

It also brings tooling around, like easy checkout and patch generation.

Why?

This approach has proven successful in grafana/k6#3696 and has many benefits. For example, we can clearly identify the difference between K6's and WPT test suites.

It also improves developer (and reviewer) UX.

Closes: #81

@olegbespalov olegbespalov self-assigned this Oct 25, 2024
@olegbespalov olegbespalov requested a review from a team as a code owner October 25, 2024 08:17
@olegbespalov olegbespalov requested review from mstoykov and oleiade and removed request for a team October 25, 2024 08:17
@olegbespalov olegbespalov force-pushed the feat/web-platform-tests branch from e6e8359 to 9637d44 Compare October 25, 2024 08:20
@oleiade
Copy link
Member

oleiade commented Oct 25, 2024

I'll name @joanlopez for this review in my place if that's okay with you folks, as he drove this work on streams before and would likely have much more insights to offer than me 🙇🏻

@oleiade oleiade requested review from joanlopez and removed request for oleiade October 25, 2024 08:27

gotErr := ts.EventLoop.Start(func() error {
err := executeTestScripts(ts.VU.Runtime(), "./tests/generateKey", "successes.js")
err := executeTestScripts(ts.VU.Runtime(), webPlatformTestSuite+"generateKey", "successes.js")
Copy link
Contributor

Choose a reason for hiding this comment

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

I pointed out this in the RSA PR, but a lot of those test seem very similar and likely can be a table test instead.

Comment on lines +9 to +10
- var subtle = self.crypto.subtle;
+ var subtle = crypto.subtle;
Copy link
Contributor

Choose a reason for hiding this comment

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

Again I comment on this in the RSA test , but we can set globalThis.self to globalThis and won't need to do this everywhere.

Comment on lines +9 to +11
- done();
-
-
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems very strange ... Can we maybe have comments in the places where we do strange changes :)

Copy link
Contributor

@mstoykov mstoykov left a comment

Choose a reason for hiding this comment

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

Thank you for doing this nad LGTM in general.

I would really prefer if every change has a comment on why we are doing this. Some do whcih is great, but some that seem "strange" do not and I wonder to what extend that is "this is not needed for us" and "we have not implemented something" or "we implemented something wrongly".

I would argue (as I have done for other test suties including tc39's test262) to just add empty implementations in cases where we do not have to do something special for example, instead of changingthe tests

@olegbespalov
Copy link
Contributor Author

I would really prefer if every change has a comment on why we are doing this. Some do whcih is great, but some that seem "strange" do not and I wonder to what extend that is "this is not needed for us" and "we have not implemented something" or "we implemented something wrongly".

I do accept all the comments and will be happy to implement them, but probably as part of the following PR since I'd like to merge firstly this and RSA support. I will open take anyway 👍

@olegbespalov olegbespalov mentioned this pull request Oct 25, 2024
@olegbespalov olegbespalov merged commit af6be62 into main Oct 25, 2024
11 checks passed
@olegbespalov olegbespalov deleted the feat/web-platform-tests branch October 25, 2024 14:36
@olegbespalov
Copy link
Contributor Author

@joanlopez I've merged to run the PRs train. Feel free to drop more feedback here since in any case, soon I'll open one more to address Mihails suggestions

Copy link

@joanlopez joanlopez left a comment

Choose a reason for hiding this comment

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

@joanlopez I've merged to run the PRs train. Feel free to drop more feedback here since in any case, soon I'll open one more to address Mihails suggestions

Hey @olegbespalov! I did review these changes and I don't have any comment that isn't covered yet by Mihail's suggestions, so 👌🏻 Great work! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Downloading Web Platform Tests
4 participants