r-lib / vdiffr

Visual regression testing and graphical diffing with testthat
https://vdiffr.r-lib.org
Other
180 stars 31 forks source link

How to solve issue of _snaps folder too large for CRAN (can't use .Rbuildignore) #126

Open jgabry opened 1 year ago

jgabry commented 1 year ago

Hi, thanks for the great package. I'm wondering if you have a recommendation for handling the following issue:

Sorry if I'm overlooking an obvious solution or if I missed a recommendation for this somewhere (I did a bunch of searching before opening this issue).

gavinsimpson commented 1 year ago

I'm hitting this too and I don't think I have an excessive number of snapshots.

Would it be possible compress the individual svg files, and then uncompress them when reading in the snapshot for comparison? This will make tests slower but would drastically reduce the size of the svgs.

gavinsimpson commented 1 year ago

svglite supports compressed svg if the filename has extension .svgz, so writing compressed SVG should be easy to handle. Not sure what's required on the testthat end to open these compressed svg files when comparing snapshots.

@lionel- where's the best place to raise this further? With the testthat developers?

lionel- commented 1 year ago

@gavinsimpson yup I think so