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

Add WPT as optional tests for boa_runtime #4008

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

Conversation

hansl
Copy link
Contributor

@hansl hansl commented Sep 26, 2024

To run the tests, you require adding the wpt-tests feature and setting the WPT_ROOT environment variable on the command line.

Example:

WPT_ROOT=$HOME/Sources/hansl/wpt cargo test -p boa_runtime --features "wpt-tests"

The current set of curated tests are all working. Some tests have been marked as ignore with a TODO for further work.

Some methods are NOT currently supported (some don' make sense
outside of a browser context). They are still implemented but
will throw a JavaScript Error.

Supported methods should follow the specification perfectly.
To run the tests, you require adding the `wpt-tests` feature
and setting the `WPT_ROOT` environment variable on the
command line. This is currently depending on a pending rstest
PR: la10736/rstest#277

The current set of curated tests are all working.
Copy link

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 15.38462% with 11 lines in your changes missing coverage. Please review.

Project coverage is 53.79%. Comparing base (6ddc2b4) to head (4062561).
Report is 339 commits behind head on main.

Files with missing lines Patch % Lines
core/runtime/src/console/mod.rs 25.00% 6 Missing ⚠️
core/runtime/tests/wpt.rs 0.00% 3 Missing ⚠️
core/runtime/src/url.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4008      +/-   ##
==========================================
+ Coverage   47.24%   53.79%   +6.55%     
==========================================
  Files         476      486      +10     
  Lines       46892    48398    +1506     
==========================================
+ Hits        22154    26037    +3883     
+ Misses      24738    22361    -2377     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hansl hansl marked this pull request as ready for review November 5, 2024 04:54
@nekevss nekevss requested a review from a team November 5, 2024 15:44
@nekevss nekevss added the enhancement New feature or request label Nov 5, 2024
Comment on lines 35 to 41
wpt-tests = []
# This feature is used to disable compiling the WPT tests in the CI
# when using `--all-features`. If this feature is enabled, we disable
# the compilation of the WPT tests (since they will panic).
# Clippy will be disabled for those methods as well, but they're one
# line long.
wpt-tests-do-not-use = []
Copy link
Member

@jedel1043 jedel1043 Nov 19, 2024

Choose a reason for hiding this comment

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

Hmmm, I think it's slightly weird to have tests be enabled by features instead of by only the test cfg. Can we just have a separate crate in the workspace for wpt tests, just like boa_tester? We could also potentially merge them together in the future.

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

Successfully merging this pull request may close these issues.

3 participants