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 for Issue 2390--Add JavaScript testing. #2392

Merged
merged 3 commits into from
Nov 11, 2021
Merged

Fix for Issue 2390--Add JavaScript testing. #2392

merged 3 commits into from
Nov 11, 2021

Conversation

kaby76
Copy link
Contributor

@kaby76 kaby76 commented Nov 10, 2021

This PR adds JavaScript testing back into the CI GitHub Actions build.

  • Updates _scripts/regtest.sh so that one can do an "invert" run of the skip list (test all in the skip list itself rather than test everything except the skip list grammars);
  • Add JavaScript back to GitHub main.yml;
  • Remove selected skipped grammars because the grammars now work;
  • Update the test.sh template script for JavaScript: output is truncated so tests of grammars like sql/plsql don't clog the logs with too much output;
  • Add file "skp-javascript.why", which is just documentation on why some of the grammars are actually skipped. Generally, the problems fall into (a) not ported to JavaScript, (b) parsing errors still (bug in Antlr or maybe the driver), (c) bug in the driver code ErrorCaptureStackTrace(err) undefined, (d) stack overflow, (e) doesn't contain a functioning grammar, or incomplete.

… an "invert" run of the skip list (test all in the skip list); (2) Add JavaScript back to GitHub main.yml; (3) Remove selected skipped grammars, as they now work; (4) Update the test.sh script for testing JavaScript parsers, cut off excessive output for parsers like sql/plsql which output way too much. (5) Add "skp-javascript.why" to indicate why certain grammars are in the skip-javascript.txt "skip list". #2390
@kaby76
Copy link
Contributor Author

kaby76 commented Nov 10, 2021

@studentmain Good idea. I will try to do that.

Not exactly sure why regtest.sh is running cleanly on my machine, while test.ps1 here in GitHub Actions is reporting errors. Oh yes, it definitely looks like the skip list isn't being handled consistently between regtest.sh and test.ps1. This must be fix--I will investigate.

@kaby76
Copy link
Contributor Author

kaby76 commented Nov 10, 2021

The difference in what is reported as an error in the build between regtest.sh and test.ps1 is caused by a simple difference in interpretation of the results of trgen. regtest.sh considers a grammar as "failed" if trgen returns the name in stderr; test.ps1 considers a grammar as "failed" if trgen didn't actually generate a "Generated/" directory. In some of the grammars, the pom.xml has not the usual two plug-in specifications (one for running the Antlr4 tool on the grammar(s), the other for running the generated parser on input files), but just one--only test whether the Antlr4 tool compiles the grammar cleanly. When there isn't the test plug-in spec in the pom.xml, trgen doesn't know what the grammar is, what the start symbol is for the grammar. Without that information, it doesn't know what to do and doesn't generate anything at all. What should happen is to at least generate a makefile that runs the Antlr4 tool. For now, I will add in these grammars to the skip list. In case when trgen really fails on the pom, do not generate partially filled Generated/ directories. I am planning to update the build with the latest trgen, but after I fix this build.

…to output the version of nodejs. Update specific "engine" version after this change.
…uts to stdout, nothing outputed. Update main.yml to install s apecific version for nodejs. I use 16.13.0 on Ubuntu and it works.
@kaby76
Copy link
Contributor Author

kaby76 commented Nov 11, 2021

All set. Javascript testing is back.

@KvanTTT KvanTTT added infrastructure target:javascript Grammars for JavaScript target, https://github.com/antlr/antlr4/blob/master/doc/javascript-target.md labels Nov 11, 2021
@teverett
Copy link
Member

@kaby76 thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure target:javascript Grammars for JavaScript target, https://github.com/antlr/antlr4/blob/master/doc/javascript-target.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants