Skip to content

Commit d872ff1

Browse files
committed
chore: remove Crashpad directory when checking the package
1 parent 2a768eb commit d872ff1

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

DESCRIPTION

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Imports:
3030
shiny.react (>= 0.4.0),
3131
utils
3232
Suggests:
33+
chromote,
3334
covr,
3435
knitr,
3536
lintr (>= 3.0.0),
@@ -38,5 +39,6 @@ Suggests:
3839
rmarkdown,
3940
shiny.router,
4041
shinytest2,
41-
testthat (>= 3.0.0)
42+
testthat (>= 3.0.0),
43+
withr
4244
Config/testthat/edition: 3
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# ❯ checking for detritus in the temp directory ... NOTE
2+
# Found the following files/directories:
3+
# ‘Crashpad’
4+
#
5+
# 0 errors ✔ | 0 warnings ✔ | 1 note ✖
6+
# Error: Error: R CMD check found NOTEs
7+
# Flavors: ubuntu-22.04 (devel), ubuntu-22.04 (release), ubuntu-22.04 (oldrel)
8+
9+
# References (shinytest2 github):
10+
# 1. https://github.com/rstudio/shinytest2/blob/main/cran-comments.md
11+
# 2. https://github.com/rstudio/shinytest2/blob/main/tests/testthat/setup-disable-crashpad.R
12+
13+
# Disable crash reporting on CRAN machines. (Can't get the report anyways)
14+
chromote::set_chrome_args(c(
15+
# https://peter.sh/experiments/chromium-command-line-switches/#disable-crash-reporter
16+
#> Disable crash reporter for headless. It is enabled by default in official builds
17+
"--disable-crash-reporter",
18+
chromote::default_chrome_args()
19+
))
20+
21+
# Make sure the temp folder is removed when testing is complete
22+
withr::defer({
23+
24+
# Clean up chromote sessions
25+
gc() # Run R6 finalizer methods
26+
Sys.sleep(2) # Wait for any supervisors to exit
27+
28+
# Delete the Crashpad folder if it exists
29+
unlink(file.path(tempdir(), "Crashpad"), recursive = TRUE)
30+
}, envir = testthat::teardown_env())

0 commit comments

Comments
 (0)