aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/setup_script.R
diff options
context:
space:
mode:
authorRanke Johannes <johannes.ranke@agroscope.admin.ch>2026-09-07 13:45:39 +0200
committerRanke Johannes <johannes.ranke@agroscope.admin.ch>2026-09-07 13:45:39 +0200
commit48d9cad339394c3aa0d730d9a27b1c0680ce13e8 (patch)
tree9c0a5766f3d0853c382ba0174f83e2e8ac9b0fbf /tests/testthat/setup_script.R
parent46735d7a6d429bb0c50f951763797f321a0d77ca (diff)
Add DTx function, check and testHEADmain
The tolerance of one test had to be increased in test_deSolve.R, and four vdiffr snapshots with negligible differences were updated. Tests run with a maximum of 16 cores when running in the Agroscope Apptainer environment.
Diffstat (limited to 'tests/testthat/setup_script.R')
-rw-r--r--tests/testthat/setup_script.R7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/testthat/setup_script.R b/tests/testthat/setup_script.R
index b2147fbe..111daa30 100644
--- a/tests/testthat/setup_script.R
+++ b/tests/testthat/setup_script.R
@@ -4,7 +4,12 @@ require(testthat)
# Per default (on my box where I set NOT_CRAN in .Rprofile) use all cores minus one
# Otherwise (CRAN check systems) use the allowed maximum of two cores
if (identical(Sys.getenv("NOT_CRAN"), "true")) {
- n_cores <- parallel::detectCores() - 1
+ # We cannot use all course if on the Agroscope cluster, if not we use all but one
+ if (grepl("agsad.admin.ch", Sys.getenv("http_proxy"))) {
+ n_cores = 16
+ } else {
+ n_cores <- parallel::detectCores() - 1
+ }
} else {
n_cores <- 2
}

Contact - Imprint