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

Use insta or expect_test for snapshot based testing of the parser #254

Open
39555 opened this issue Nov 3, 2024 · 1 comment
Open

Use insta or expect_test for snapshot based testing of the parser #254

39555 opened this issue Nov 3, 2024 · 1 comment
Labels
enhancement New feature or request testing Related to testing infrastructure or tests

Comments

@39555
Copy link
Contributor

39555 commented Nov 3, 2024

@reubeno
Copy link
Owner

reubeno commented Nov 3, 2024

I completely agree those parser/tokenizer tests aren't scaling well. I'd previously looked into insta; it looks really promising, just didn't seem like the right fit for our compatibility integration tests. I'm interested in the idea of using it with component-level tests focused on the tokenizer and parser.

(Aside: we'd historically been light on the tokenizer/parser tests, as their results had been less stable--but also less important. As long as we provide the right end-to-end semantics that match bash, we're good to go. With that said, these tokenizer/parser tests can be extremely helpful in pinpointing regressions and unexpected behavior at lower levels. I frequently use VSCode's test running/debugging experiences to step through the code-under-test in some of those tests. Now that things are relatively stable, I support the idea of strengthening these lower-level tests.)

If you (or someone else) is interested, I'd be supportive of seeing a draft PR that demonstrates how we could use insta or similar in one of these cases, with 1 or 2 test cases -- i.e., before jumping ahead to switching everything over to it. Once we can get the right pattern and make sure we've got what we need to run/debug/update tests, then we could move forward to documenting the pattern and adopting it.

@reubeno reubeno added enhancement New feature or request testing Related to testing infrastructure or tests labels Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request testing Related to testing infrastructure or tests
Projects
None yet
Development

No branches or pull requests

2 participants