Skip to content

Commit cc8b4d6

Browse files
committed
test: Disable Crashpad for shinytest2.
1 parent ef44fb9 commit cc8b4d6

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
+30
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)