From 99036ed8c02b131ff67c54a7c88f1b15fe24a8d2 Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Wed, 10 Jan 2024 17:47:39 -0800 Subject: [PATCH] Notes around continuing styler caching pain --- tests/testthat/helper.R | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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"),