-
Notifications
You must be signed in to change notification settings - Fork 888
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
Integrate Test262 #622
Integrate Test262 #622
Conversation
Retrieve the Test262 project from its canonical location on GitHub.com. Use the `test262-stream` module to create tests in accordance with that project's interpretation guidelines. Use the `results-interpreter` project to maintain a "whitelist" file of tests which Acorn is currently expected to fail.
Hi, thanks for the PR! A few observations:
|
Got it. I've reverted my changes to the
I've implemented equivalent behavior using the list of excluded feature flags from your patch. Note that this patch's whitelist is much smaller. I've compare the console output from both, and I think the other version has some extra entries. Here's the output from gh-615;
And here's the output from this patch:
Finally, I've modified the git URL used to reference Test262 to ensure that it can be successfully retrieved from the TravisCI environment. Thanks for the review! |
@adrianheine Thinking a bit more about this, I'm wondering if it would be The reason I feel this might be a better solution is that it will help with If we extend the whitelist with expected failures here today, then when support The only drawback to this is that every time Acorn updates its version of What do you think? |
Hi there Kenny! I should start by saying that this is an attempt to satisfy a Many of the tests are for features that have not yet reached stage 4. Other All the tests include meta-data describing how implementers should interpret A vast majority of the tests are for runtime semantics. From a parser's When it comes to triaging issues from confused contributors, it's probably best Regarding the unfound files: it looks as though you are running the tests from |
Hi @isiahmeadows. I'm wondering if/how our recent conversation reflects your interest in running Test262 within Acorn. Your participation has already set some improvements in motion, and I'm sure that formally integrating the test suite in Acorn will lead to still more. Actually, that's one of my reasons for making this contribution: many ECMAScript interpreters (both runtimes and parsers) stand to benefit from Acorn's participation. Is there anything more I can do to help see this through to |
@jugglinmike You're probably talking to the wrong person. I have little to no involvement in any active parser project; I only wrote the script for a friend, and it was my troubles in adapting the tests that spurred me to file the Test262 issue. The script itself in the gist, linked to from that issue, does come with basic instructions on how to integrate it. It's pretty straightforward. |
Oh, my mistake! I guess maybe we should hear from @marijnh then. Marijn: this is my attempt to resolve gh-510. Isiah has identified a few patterns in Test262 where parsing tests are expressed with What do you think? |
As it currently stands, this implementation takes 3-4 times as long as #615, but this could be fixed with bocoup/test262-stream#2. I still think skipping is better than whitelisting for tests for features acorn does not support, but I see your point with regards to not forgetting to remove the skip once the feature is implemented. I would just hope that people keep these tests in mind. Aside from that there is not much of a difference between both pull requests. |
@adrianheine For context, the script that's being referenced here is in this gist. And although it wasn't mentioned here, there is an option to skip various features as well as an option to skip entire globs (relative to the test262 directory). Just thought I'd clear that up. |
I was referring to this pull request, not your script. Thanks for the link, though. |
I've decided to go with #615 instead, since it appears to involve less new moving parts. |
Yeah, I'm interested in limiting complexity, too. I recently submitted a patch to halve the dependencies in |
Integrate Test262
This patch is intended to resolve gh-510. It introduces three new dependencies:
test262-stream
- A Node.js API for traversing the Test262 test suite (this creates the test code based on the contents of the Test262 directory)results-interpreter
- A Node.js transform stream for interpreting streaming test results (this implements the code necessary to interpret the results in terms of a whitelist file)These projects were created to reduce duplication (both in code and in maintenance effort) between Test262 consumers. They're based on my experience integrating that project with JSHint and Babylon. Referring to Test262 via a git SHA allows this project's maintainers to control when the tests should be updated.
For this initial version, I've simply appended the test execution to the project's existing
npm test
command. On my system, Acorn takes about 40 seconds to run all the tests, and I'm not sure if that's "fast enough" to warrant its inclusion here. Alternatively, we could define a dedicated npm script and configure the CI environment to run it in a separate job. I'll hold off on any optimizations until I hear back from the maintainers.Retrieve the Test262 project from its canonical location on GitHub.com.
Use the
test262-stream
module to create tests in accordance with thatproject's interpretation guidelines. Use the
results-interpreter
project to maintain a "whitelist" file of tests which Acorn is currently
expected to fail.