Skip to content

Commit

Permalink
Notes around continuing styler caching pain
Browse files Browse the repository at this point in the history
  • Loading branch information
jennybc committed Jan 11, 2024
1 parent 1566d2e commit 99036ed
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/testthat/helper.R
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down

0 comments on commit 99036ed

Please sign in to comment.