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

#3696 - tc39-test262 Crate #3708

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

Conversation

PawelJastrzebski
Copy link

@PawelJastrzebski PawelJastrzebski commented Feb 29, 2024

This Pull Request closes #3696.

It changes the following:

  • transfers boa_tester parser logic to tools/tc39-test262 crate

@PawelJastrzebski PawelJastrzebski marked this pull request as draft February 29, 2024 13:45
Copy link

codecov bot commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 0% with 170 lines in your changes are missing coverage. Please review.

Project coverage is 47.37%. Comparing base (6ddc2b4) to head (154f7a1).
Report is 80 commits behind head on main.

❗ Current head 154f7a1 differs from pull request most recent head 5e85673. Consider uploading reports for the commit 5e85673 to get more accurate results

Files Patch % Lines
tools/tc39-test262/src/git.rs 0.00% 58 Missing ⚠️
tools/tc39-test262/src/test_flags.rs 0.00% 55 Missing ⚠️
tools/tc39-test262/src/structs.rs 0.00% 26 Missing ⚠️
tools/tc39-test262/src/test_files.rs 0.00% 20 Missing ⚠️
tools/tc39-test262/src/lib.rs 0.00% 6 Missing ⚠️
tools/tc39-test262/src/read.rs 0.00% 4 Missing ⚠️
tools/tc39-test262/src/edition.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3708      +/-   ##
==========================================
+ Coverage   47.24%   47.37%   +0.12%     
==========================================
  Files         476      461      -15     
  Lines       46892    44846    -2046     
==========================================
- Hits        22154    21245     -909     
+ Misses      24738    23601    -1137     

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

@PawelJastrzebski PawelJastrzebski marked this pull request as ready for review March 16, 2024 10:24
@PawelJastrzebski PawelJastrzebski changed the title #3696 - WIP #3696 - tc39-test262 Crate Mar 16, 2024
Copy link
Author

@PawelJastrzebski PawelJastrzebski left a comment

Choose a reason for hiding this comment

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

Merge comments

@@ -220,54 +220,6 @@ impl RunTest<OptimizerOptions, TestResult> for Test {
}
}

/// Creates the test result from the outcome and message.
fn create_result<S: Into<Box<str>>>(
Copy link
Author

Choose a reason for hiding this comment

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

Moved to helper function (Out of Trait)

@@ -87,9 +93,13 @@ static FEATURE_EDITION: phf::Map<&'static str, SpecEdition> = phf::phf_map! {
// https://github.com/tc39/proposal-set-methods
"set-methods" => SpecEdition::ESNext,

// Regular Expression Pattern Modifiers
// https://github.com/tc39/proposal-regexp-modifiers
"regexp-modifiers" => SpecEdition::ESNext,
Copy link
Author

Choose a reason for hiding this comment

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

Duplicate in line 76

Copy link
Member

@jedel1043 jedel1043 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 all the work!

It's been several days going back and forth on this PR about whether to put the feature to editions map into the new crate or the tester.

On the one hand, features are part of the test262 suite and we may include them to also get the edition of a test. On the other hand, if we include them, we would need to keep the crate pretty much updated with every new commit to the test262 repo, which would be a pretty big maintenance work for us.

I'm tending towards leaving the editions on the tester, since I don't see many use cases for it aside from engine tests. What do you think?

@PawelJastrzebski
Copy link
Author

I wonder if would be ok for tests that contains unknown features set edition to ESNext as a fallback option. I guess in that case they could be marked as ignored as well.

Thinking long term:

  • test262 repo contains list of features features.txt.
  • We could read from that to find out if missing feature pass through the proposal stage, and only then break the parsing process with an error.

image

@jedel1043
Copy link
Member

I wonder if would be ok for tests that contains unknown features set edition to ESNext as a fallback option. I guess in that case they could be marked as ignored as well.

That would also be a good option for the short-term.

On the long term, I'm trying to push for adding this metadata to test262 (tc39/test262#4161). This would essentially remove the need for the map, probably making it a HashMap<String, u8> in the future.

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.

Split boa_tester into crates
2 participants