vdiffr 0.3.0

This release of vdiffr features a major overhaul of the internals to make the package more robust.

Cross-platform reliability

vdiffr now works reliably across platforms:

While this makes vdiffr much more robust, it also means you will have to regenerate all your testcases with the new version of vdiffr. You can expect very few future releases that will require updating figures, hopefully once every few years.

Now that vdiffr has a stable engine, the next release will focus on improving the Shiny UI.

Regression testing versus Unit testing

Another important change is that figure mismatches are no longer reported as failures, except when the tests are run locally, on Travis, Appveyor, or any environment where the Sys.getenv("CI") or Sys.getenv("NOT_CRAN") variables are set. Because vdiffr is more of a monitoring than a unit testing tool, it shouldn’t cause R CMD check failures on the CRAN machines.

Despite our efforts to make vdiffr robust and reliable across platforms, checking the appearance of a figure is still inherently fragile. It is similar to testing for errors by matching exact error messages: these messages are susceptible to change at any time. Similarly, the appearance of plots depends on a lot of upstream code, such as the way margins and spacing are computed. vdiffr uses a special ggplot2 theme that should change very rarely, but there are just too many upstream factors that could cause breakages. For this reason, figure mismatches are not necessarily representative of actual failures.

Visual testing is not an alternative to writing unit tests for the internal data transformations performed during the creation of your figure. It is more of a monitoring tool that allows you to quickly check how the appearance of your figures changes over time, and to manually assess whether changes reflect actual problems in your package.

If you need to override the default vdiffr behaviour on CRAN (not recommended) or Travis (for example to run the tests in a particular builds but not others), set the VDIFFR_RUN_TESTS environment variable to “true” or “false”.

Features

Life cycle

vdiffr 0.2.3

vdiffr 0.2.2

vdiffr 0.2.1

This release fixes some CRAN failures.

vdiffr 0.2.0

This release makes it easier to debug failures on remote systems. It also makes vdiffr more robust to failures caused by incompatible installations: instead of failing, the tests are skipped. This prevents spurious failures on CRAN.

Troubleshooting on remotes

Handling of incompatible systems

The tests are now skipped if the FreeType version used to build the comparison SVGs does not match the version installed on the system where the tests are run. This is necessary because changes in new version of FreeType might affect the computation of text extents, which then causes svglite to produce slightly different SVGs. The minor version is not taken into account so FreeType 2.7.1 is deemed compatible with 2.7.2 but not with 2.8.0.

In practice, this means that package contributors should only validate visual cases if their FreeType version matches the one of the package maintainer. Also, the maintainer must update the version recorded in the package repository (in the file ./tests/figs/deps.txt) when FreeType has been updated on their system. Running vdiffr::validate_cases() updates the dependency file even if there are no visual case to update.

In the future, we may provide a version of vdiffr statically compiled with a specific version of FreeType to prevent these issues.

Other changes

vdiffr 0.1.1

vdiffr 0.1.0

vdiffr 0.0.0.9000

Initial release