Open jtlandis opened 4 months ago
I can confirm that setting the following in the testthat.R
file has helped skip vdiffr
tests on CI.
if ((nzchar(Sys.getenv("CI")) ||
!nzchar(Sys.getenv("NOT_CRAN"))) &&
identical(Sys.getenv("VDIFFR_RUN_TESTS"), 'false')) {
#if we are running tests remotely AND
# we are opting out of using vdiffr
# assigning a dummy function
expect_doppelganger <- function(...) {
testthat::skip("`VDIFFR_RUN_TESTS` set to false on this remote check")
}
} else {
expect_doppelganger <- vdiffr::expect_doppelganger
}
@jtlandis This sounds like it would solve my issue #143 (I didn't realise your issue was related before I submitted mine). Where are you setting the VDIFFR_RUN_TESTS
env var?
Uggh @jtlandis, sorry, I must be having one of those days as I completely missed where you set this in your workflow YAML. I swear I did check before asking 🤦🏻
My issue was related to my ggside
package. You can find how I have configured this environment variable here
Thanks @jtlandis; I found where you were doing this, hence my second comment. Your solution was very useful - I have implemented this in several workflows now.
I have an R package that is consistently failing GHA for Linux r: devel. I was trying to follow
ggplot2
's github actions workflow yaml to skip tests based on the version of r, but for some reason it doesn't seem that any of the tests are skipped. I also did a quick grep in the code and I didn't find any instance of when "VDIFFR_RUN_TESTS" in the code anymore. It seems like it was once apart of the code base, but not anymoreAm I missing something?