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

Integrate with Insta for testing #112

Open
3 of 4 tasks
cljoly opened this issue Dec 6, 2023 · 0 comments
Open
3 of 4 tasks

Integrate with Insta for testing #112

cljoly opened this issue Dec 6, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@cljoly
Copy link
Owner

cljoly commented Dec 6, 2023

Insta is a popular snapshot testing tool for Rust. I’m not too familiar with it, but it seems that this library could be integrated with it in two ways (they are not exclusive):

  1. Version snapshots of the Migrations along with the code. We should already support this, thanks to the Debug serialisation implemented on this struct.
  2. Just like we have a validate method for testing convenience, we could also have a method that outputs the final state of the database (or of the internal tables holding the schema?) after running all the migrations. That would be what insta would snapshot.
  • The use of all those features should be documented in the Readme.
  • This may be a good chance to introduce insta on our own tests.

It would go some way to achive the goals of #101, but in less complex and intrusive way:

  • it would be just a fuction, and
  • it would compose with the framework users already use for snapshot testing.
@cljoly cljoly added the enhancement New feature or request label Dec 6, 2023
@cljoly cljoly changed the title Integrate with insta Integrate with insta for testing Dec 6, 2023
@cljoly cljoly changed the title Integrate with insta for testing Integrate with Insta for testing Dec 6, 2023
@cljoly cljoly added the documentation Improvements or additions to documentation label Dec 6, 2023
@cljoly cljoly added this to the Version 1.1.0 milestone Dec 7, 2023
cljoly added a commit that referenced this issue Dec 7, 2023
Slightly adjusted the Debug representation to make it reproducible (the
value of function pointers obviously isn’t).

Regarding #112, this validates that Debug is enough to use insta, but
documenting this is left for a later PR.
@cljoly cljoly removed this from the Version 1.1.0 milestone Dec 7, 2023
cljoly added a commit that referenced this issue Dec 10, 2023
Slightly adjusted the Debug representation to make it reproducible (the
value of function pointers obviously isn’t).

Regarding #112, this validates that Debug is enough to use insta, but
documenting this is left for a later PR.
cljoly added a commit that referenced this issue Dec 10, 2023
Slightly adjusted the Debug representation to make it reproducible (the
value of function pointers obviously isn’t).

Regarding #112, this validates that Debug is enough to use insta, but
documenting this is left for a later PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant