Compressing the snap files
Suggestion
My snap files are usually pretty large (thousands of lines of code), and adding them to the git repository pollutes the dev experience. I think it would be nice to maintain the compressed version of the snap files under the snapshot folder
P.S. I have written a script for one of my repos, and I can make it a feature of insta itself if you like.
Edit: I created a pull request that fixes the issue: https://github.com/mitsuhiko/insta/pull/279
Would you commit compressed files to git? My hunch is that in terms of repository size actually adding compressed files rather than raw files is probably worse or at least not better considering that git compresses itself anyways.
How do you work with snapshots which are not committed to version control? Do you use something else to store them?
Yeah, currently that's what I am doing, but the compressed files can be kept somewhere else as well.
In the PR I made, the original snap files are kept in the temporary files. See #279
Hey, I’m late to the party, but you may be interested in what we’re doing in Meilisearch thanks to @loiclec.
Basically, when the snapshots get too big, we only push a hash of the snapshot instead of pushing big files or compressing the files.
But locally, we keep the uncompressed snap files, and you can see the « real » diff by settings the MILLI_TEST_FULL_SNAPS env variable.
Kinda related to this issue. I was able to significantly reduce the size of my data by using postcard instead of json files.
Also, see: https://github.com/mitsuhiko/insta/issues/196#issuecomment-1290048650