diff --git a/tests/testthat/helper.R b/tests/testthat/helper.R index edb7f609..04b00bca 100644 --- a/tests/testthat/helper.R +++ b/tests/testthat/helper.R @@ -1,5 +1,15 @@ - -# Work around R.cache bug on CI +# Work around some bug in R.cache and/or styler that affects CI ---- +# 2024-01: Since this went in, I have seen yet another CI failure due to what I +# assume is this directory not existing, presumably because some code in styler +# deleted it, after we created it here. +# The problem seemed to go away upon further investigation, so it seems +# somewhat stochastic. +# See https://github.com/tidyverse/reprex/pull/455. +# If we have to debug this again, these are some thoughts: +# * When we forcibly create the directory, also put a file in it. That might +# keep styler from deleting it. +# * Figure out how to deactivate all styler caching for reprex, at least on CI. +# Seems to require `options(styler.cache_name = NULL)`. if (getRversion() >= "4.0.0" && identical(Sys.getenv("CI"), "true")) { dir.create( tools::R_user_dir("R.cache", which = "cache"),