-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove Crashpad directory when checking the package
- Loading branch information
Jakub Sobolewski
committed
May 22, 2024
1 parent
2a768eb
commit 9e3a238
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# ❯ checking for detritus in the temp directory ... NOTE | ||
# Found the following files/directories: | ||
# ‘Crashpad’ | ||
# | ||
# 0 errors ✔ | 0 warnings ✔ | 1 note ✖ | ||
# Error: Error: R CMD check found NOTEs | ||
# Flavors: ubuntu-22.04 (devel), ubuntu-22.04 (release), ubuntu-22.04 (oldrel) | ||
|
||
# References (shinytest2 github): | ||
# 1. https://github.com/rstudio/shinytest2/blob/main/cran-comments.md | ||
# 2. https://github.com/rstudio/shinytest2/blob/main/tests/testthat/setup-disable-crashpad.R | ||
|
||
# Disable crash reporting on CRAN machines. (Can't get the report anyways) | ||
chromote::set_chrome_args(c( | ||
# https://peter.sh/experiments/chromium-command-line-switches/#disable-crash-reporter | ||
#> Disable crash reporter for headless. It is enabled by default in official builds | ||
"--disable-crash-reporter", | ||
chromote::default_chrome_args() | ||
)) | ||
|
||
# Make sure the temp folder is removed when testing is complete | ||
withr::defer({ | ||
|
||
# Clean up chromote sessions | ||
gc() # Run R6 finalizer methods | ||
Sys.sleep(2) # Wait for any supervisors to exit | ||
|
||
# Delete the Crashpad folder if it exists | ||
unlink(file.path(tempdir(), "Crashpad"), recursive = TRUE) | ||
}, envir = testthat::teardown_env()) |