Skip to content

Commit

Permalink
Merge pull request #105 from mrc-ide/mrc-3196
Browse files Browse the repository at this point in the history
  • Loading branch information
richfitz committed May 9, 2022
2 parents 25d7104 + 9dcdcae commit 2df52b3
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
@@ -1,6 +1,6 @@
Package: didehpc
Title: DIDE HPC Support
Version: 0.3.10
Version: 0.3.11
Authors@R: c(person("Rich", "FitzJohn", role = c("aut", "cre"),
email = "rich.fitzjohn@gmail.com"),
person("Wes", "Hinsley", role = "aut"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
@@ -1,3 +1,7 @@
# didehpc 0.3.11

Fix path issues and support cmdstandr/RTools.

# didehpc 0.3.9

Add support for new infiniband storage on covid cluster headnode.
Expand Down
4 changes: 2 additions & 2 deletions R/config.R
Expand Up @@ -466,9 +466,9 @@ check_worker_resource <- function(worker_resource, cluster, template,
rtools_versions <- function(path, r_version) {
r_version_2 <- as.character(r_version[1, 1:2])
if (r_version < "4.0.0") {
mingw <- "mingw_$(WIN)"
mingw <- "mingw_%R_BITS%"
} else {
mingw <- "mingw$(WIN)"
mingw <- "mingw%R_BITS%"
}

ret <- switch(r_version_2,
Expand Down
3 changes: 3 additions & 0 deletions inst/template_shared.bat
Expand Up @@ -10,6 +10,9 @@ set CONTEXT_WORKDIR={{context_workdir}}
set CONTEXT_ROOT={{context_root}}
set CONTEXT_ID={{context_id}}
set R_LIBS_USER={{r_libs_user}}
set RTOOLS35_HOME=T:\Rtools\Rtools35
set RTOOLS40_HOME=T:\Rtools\Rtools40
set RTOOLS42_HOME=T:\Rtools\Rtools42

call setr64_{{r_version}}.bat

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-batch.R
Expand Up @@ -45,7 +45,7 @@ test_that("Can create path and template data", {


test_that("batch data creates entries for share drives", {
config <- example_config(r_version = numeric_version("4.0.3"))
config <- example_config(r_version = numeric_version("4.0.5"))
root <- file.path(config$workdir, "context")
dir.create(root, FALSE, TRUE)
context_id <- ids::random_id()
Expand All @@ -58,7 +58,7 @@ test_that("batch data creates entries for share drives", {


test_that("can disable conan bootstrap", {
config <- example_config(r_version = numeric_version("4.0.3"))
config <- example_config(r_version = numeric_version("4.0.5"))
root <- file.path(config$workdir, "context")
dir.create(root, FALSE, TRUE)
context_id <- ids::random_id()
Expand Down
22 changes: 11 additions & 11 deletions tests/testthat/test-config.R
Expand Up @@ -139,19 +139,19 @@ test_that("Can find redis host, given cluster", {
test_that("Can get a reasonable rtools version", {
expect_equal(
rtools_versions("<prefix>", numeric_version("4.0.0")),
list(gcc = "mingw$(WIN)",
list(gcc = "mingw%R_BITS%",
make = "usr",
binpref = "<prefix>/Rtools/Rtools40/mingw$(WIN)/bin",
binpref = "<prefix>/Rtools/Rtools40/mingw%R_BITS%/bin",
rtools_root = "<prefix>\\Rtools\\Rtools40",
gcc_path = "<prefix>\\Rtools\\Rtools40\\mingw$(WIN)\\bin",
gcc_path = "<prefix>\\Rtools\\Rtools40\\mingw%R_BITS%\\bin",
make_path = "<prefix>\\Rtools\\Rtools40\\usr\\bin"))
expect_equal(
rtools_versions("<prefix>", numeric_version("3.6.3")),
list(gcc = "mingw_$(WIN)",
list(gcc = "mingw_%R_BITS%",
make = "",
binpref = "<prefix>/Rtools/Rtools35/mingw_$(WIN)/bin",
binpref = "<prefix>/Rtools/Rtools35/mingw_%R_BITS%/bin",
rtools_root = "<prefix>\\Rtools\\Rtools35",
gcc_path = "<prefix>\\Rtools\\Rtools35\\mingw_$(WIN)\\bin",
gcc_path = "<prefix>\\Rtools\\Rtools35\\mingw_%R_BITS%\\bin",
make_path = "<prefix>\\Rtools\\Rtools35\\\\bin"))
expect_equal(
rtools_versions("<prefix>", numeric_version("3.5.0")),
Expand All @@ -169,8 +169,8 @@ test_that("fetch r versions", {
testthat::skip_if_offline()
dat <- r_versions()
expect_is(dat, "numeric_version")
expect_true(numeric_version("4.0.3") %in% dat)
expect_true(length(dat) > 10)
expect_true(numeric_version("4.0.5") %in% dat)
expect_true(length(dat) > 4)
})


Expand All @@ -180,10 +180,10 @@ test_that("Select a sensible r version", {
vmax <- max(v)
vmid <- v[length(v) - 3]
expect_equal(select_r_version(vmax), vmax)
expect_error(select_r_version("3.4.9"),
"Unsupported R version: 3.4.9")
expect_error(select_r_version("3.6.0"),
"Unsupported R version: 3.6.0")
expect_equal(select_r_version(NULL, vmid), vmid)
expect_equal(select_r_version(NULL, "3.4.9"), numeric_version("3.5.0"))
expect_equal(select_r_version(NULL, "3.6.0"), numeric_version("3.6.3"))
})


Expand Down

0 comments on commit 2df52b3

Please sign in to comment.