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

Consider switching to insta for snapshot testing #634

Open
4 tasks
obi1kenobi opened this issue Jan 13, 2024 · 0 comments
Open
4 tasks

Consider switching to insta for snapshot testing #634

obi1kenobi opened this issue Jan 13, 2024 · 0 comments
Labels
C-enhancement Category: raise the bar on expectations E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: Mentorship is available for this issue.

Comments

@obi1kenobi
Copy link
Owner

obi1kenobi commented Jan 13, 2024

This project relies heavily on snapshot testing: we write test crates and lint them, then ensure that the outputs are both expected and haven't changed since the last run.

When cargo-semver-checks came into existence, insta wasn't nearly as polished as it's become since. These days, it's feature-rich and fairly commonly used in the ecosystem.

Our own hand-rolled snapshot testing can be a bit annoying to manage: one has to manually edit snapshot files, and observe proper item order since they are order-sensitive. However, it also allows us some conveniences: we can leave comments inside snapshot files (e.g. look at the removed lines in #631 for a useful snapshot comment), and we have tight control over how information is stored and where.

Can an insta-based workflow replicate the conveniences we care about, or offer other conveniences that make switching to it compelling?

To close this issue, we need to:

  • figure out what a good insta-based workflow would look like
  • consider whether it's better than what we have right now -- and if so
    • replace our snapshot testing with insta
    • update our CONTRIBUTING doc with the new workflow, making sure to add guidance on how to install cargo-insta and how to use insta and cargo insta productively
@obi1kenobi obi1kenobi added C-enhancement Category: raise the bar on expectations E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: Mentorship is available for this issue. labels Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: raise the bar on expectations E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: Mentorship is available for this issue.
Projects
None yet
Development

No branches or pull requests

1 participant