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

Add cram-like tests for Tact CLI #315

Open
Tracked by #136
anton-trunov opened this issue May 1, 2024 · 6 comments
Open
Tracked by #136

Add cram-like tests for Tact CLI #315

anton-trunov opened this issue May 1, 2024 · 6 comments
Labels
ci Continuous Integration cli Tact's command-line interface testing

Comments

@anton-trunov
Copy link
Member

Would be nice to have cram-like tests. It would be nice to stay within the JS/TS/Node.js ecosystem. On the other hand, something like oclif testing looks like too much JS. It should be based on snapshots, i.e. tests should look a lot like shell interaction histories, resembling e.g. this report. Btw, the cram-like framework we are going to pick should definitely support updating those snapshots.

@anton-trunov anton-trunov added testing cli Tact's command-line interface labels May 1, 2024
@novusnota
Copy link
Member

Here's the cram fork we might use, which continues developing its snapshot-based testing approach: https://github.com/prysk/prysk

@anton-trunov
Copy link
Member Author

Here's the cram fork we might use, which continues developing its snapshot-based testing approach: https://github.com/prysk/prysk

As mentioned in the original post, I'd very much prefer not to mix the Node.js and Python ecosystem within one project.

@novusnota
Copy link
Member

What if we only use it in CI? Although I agree with your point.

@anton-trunov
Copy link
Member Author

We might end up doing that, but only as the last resort, if there are no alternatives with our ecosystem

@novusnota
Copy link
Member

novusnota commented May 1, 2024

Jest has support for snapshot testing, which is probably the most compatible solution to our current repo layout: https://jestjs.io/docs/snapshot-testing

Although we'll have to wrap CLI calls a bit (in child_process calls or something like that)

@anton-trunov
Copy link
Member Author

Jest does have snapshot tests and we use it in Tact. But I also used cram-like tests a lot with OCaml (https://dune.readthedocs.io/en/stable/reference/cram.html) and it's so much better for CLI apps testing than what Jest or oclif is offering.

@anton-trunov anton-trunov added the ci Continuous Integration label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous Integration cli Tact's command-line interface testing
Projects
None yet
Development

No branches or pull requests

2 participants