Skip to content

Commit ec61d1c

Browse files
committed
Mention VDIFFR_RUN_TESTS in README
1 parent 279f661 commit ec61d1c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,17 @@ will be skipped. Failed tests will show as an error.
129129

130130
When a figure doesn't match its saved version, it is only reported as a failure under these circumstances:
131131

132-
- When the `NOT_CRAN` environment is set. In particular, devtools sets this when running the tests interactively.
132+
- When the `NOT_CRAN` environment variable is set. In particular, devtools sets this when running the tests interactively.
133133

134-
- On Travis, Appveyor, or any environment where the `Sys.getenv("CI")` is set.
134+
- On Travis, Appveyor, or any environment where `Sys.getenv("CI")` is set.
135135

136136
Otherwise, the failure is ignored. The motivation for this is that vdiffr is a monitoring tool and shouldn't cause R CMD check failures on the CRAN machines.
137137

138138
Checking the appearance of a figure is inherently fragile. It is a bit like 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.
139139

140140
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 packages.
141141

142-
If you want vdiffr to fail on CRAN machines as well, just set the environment variable `CI` to `"true"` in a `setup-vdiffr.R` file in your testthat folder.
142+
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".
143143

144144

145145
### RStudio integration

0 commit comments

Comments
 (0)