Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Automated testing of Wasm playground #365

Closed
torhovland opened this issue Mar 17, 2023 · 3 comments · Fixed by #394
Closed

Automated testing of Wasm playground #365

torhovland opened this issue Mar 17, 2023 · 3 comments · Fixed by #394
Labels
good first issue Good for newcomers P2 major: an upcoming release type: feature request

Comments

@torhovland
Copy link
Member

Is your feature request related to a problem? Please describe.
As grammars and Topiary code evolves separately, we are bound to break the playground at some point. We need automated tests to cover this.

Describe the solution you'd like
Either unit tests against the Wasm code, or GUI tests (e.g. Cypress) against the web playground, or both.

@nbacquey
Copy link
Member

The fact that grammars and Topiary code evolve separately is also a potential break for the CLI, and I think our tests should already catch such errors.

Do you have an example of a divergence between grammar and Topiary code that could not (should not?) be caught by the tests we already have?

That being said, having tests for the Wasm code is a good idea in general, I'm just not convinced we are threatened by divergences between grammars and Topiary code specifically, as those should be handled in the library.

@torhovland
Copy link
Member Author

The problem is when somebody updates a grammar crate (e.g. tree-sitter-nickel = { git = "https://github.com/nickel-lang/tree-sitter-nickel" }) without being aware that the Wasm grammars (e.g. web-playground/public/scripts/tree-sitter-nickel.wasm) are completely separate from this.

So if (when) a grammar crate introduces major changes, and our query files are updated to be compatible with the new grammar, the playground will stop working.

How to update the Wasm grammars is described here.

@torhovland
Copy link
Member Author

This already happened 😅
#393

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
good first issue Good for newcomers P2 major: an upcoming release type: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants