Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# CRAN incoming checks can fail if examples use more than 2 cores.
# We can run in this problem by using data.table https://github.com/Rdatatable/data.table/issues/5658
# R CMD Check throws the NOTE because CRAN sets
# _R_CHECK_EXAMPLE_TIMING_CPU_TO_ELAPSED_THRESHOLD_ to "2.5"
# which means "more than two cores are running".
# We check for this specific environment variable and run the nflreadr helper
# if it is set to any value
cpu_threshold <- as.numeric(Sys.getenv("_R_CHECK_EXAMPLE_TIMING_CPU_TO_ELAPSED_THRESHOLD_",
NA_character_))

if (!is.na(cpu_threshold)) nflreadr::.for_cran()