vdiffr
vdiffr copied to clipboard
How to solve issue of _snaps folder too large for CRAN (can't use .Rbuildignore)
Hi, thanks for the great package. I'm wondering if you have a recommendation for handling the following issue:
-
When using a lot of vdiffr visual tests the
tests/testthat/_snaps
directory becomes very large, resulting in CRAN complaining about package size. -
Adding
tests/testthat/_snaps
to.Rbuildignore
solves the CRAN problem but results in the visual tests not running (or really new snapshots are created) during R cmd check on GitHub Actions.
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).
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.
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?
@gavinsimpson yup I think so