I'm trying to do some really quick snapshot testing of PDFs. Our system generates them using Spire.PDF and sends them to DocuSign encoded in base64. My snapshots take the generated base64 and compare it against "known good" to see if anything changed.
This process has been, so far, 100% reproducible on my computer and a co-workers computer. But when we put the tests up on Jenkins, the tests fail. Looking deeper into the problem, the same test cases with the same base documents generate completely different bytes, while also generating identical looking PDFs.
Some Details
Or things I've ruled out. Or other thoughts.
- At some point in the process I have to convert to string and back, and I've checked that the encoding on my computer and Jenkins is the same.
- I've replaced any "random" meta data values like created date and ID in the PDF with static values so snapshots are possible.
- I'm open to other ideas of snapshot testing that can be done quickly! I'm looking for a "quick win" to reduce the amount of regression testing we need to do every release on this stuff, and not a "comprehensive testing solution".
- The build environment is destroyed every build and recreated, while my computer is not.
- I haven't checked that the versions of Spire are the same (because it's a weekend and I don't have dev ops permissions and politics...), but both processes are getting the library using NuGet so I don't have any reason why they might be different.
- We're licensing Spire using the embedded resource method, and neither generated PDF implies it is a trial version.
Thanks!