r-lib / vdiffr

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

Using vdiffr with DiagrammeR #102

Closed Sumidu closed 3 years ago

Sumidu commented 3 years ago

Hi, I have been trying to get vdiffr to work with the DiagrammeR package. Sadly, the DiagrammerRsvg package used for exporting svg uses the rsvg under the hood which seems to behave non-deterministically in naming some entities. I have now written my own "writer" function, which basically uses the pre-raw SVG string and puts it into a file. When calling manage_cases everything is fine. Every case is validated. However, when running R cmd test, all cases fail. How could I fix this? Can I debut the test-cases somehow?

lionel- commented 3 years ago

See the vdiffr.Rout.fail log file. You will need to make sure the SVG generation does not depend on any system library because that will be a source of differences across platforms (e.g. in Github Actions or the computers of other contributors). This is why vdiffr embeds its own SVG engine.