Skip to content

Commit c33f031

Browse files
TESTS: Don't test 'batchtools_ssh' on Windows - not supported
1 parent 259262a commit c33f031

File tree

2 files changed

+34
-31
lines changed

2 files changed

+34
-31
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future.batchtools
2-
Version: 0.12.2-9902
2+
Version: 0.12.2-9903
33
Depends:
44
R (>= 3.2.0),
55
parallelly,

inst/testme/test-batchtools_ssh.R

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
1-
library(future.batchtools)
2-
library(listenv)
1+
if (.Platform[["OS.type"]] != "windows") {
2+
library(future.batchtools)
3+
library(listenv)
4+
5+
message("*** batchtools_ssh() ...")
6+
7+
plan(batchtools_ssh, workers = 2L)
8+
supports_ssh <- tryCatch({
9+
f <- future(42L)
10+
v <- value(f)
11+
identical(v, 42L)
12+
}, error = function(e) FALSE)
13+
message("Supports batchtools_ssh: ", supports_ssh)
14+
15+
if (supports_ssh) {
16+
message("future(a) ...")
17+
a0 <- a <- 42
18+
f <- future(a)
19+
stopifnot(identical(f$globals$a, a0))
20+
v <- value(f)
21+
stopifnot(identical(v, a0))
22+
23+
message("future(a, lazy = TRUE) ...")
24+
a0 <- a <- 42
25+
f <- future(a, lazy = TRUE)
26+
rm(list = "a")
27+
stopifnot(identical(f$globals$a, a0))
28+
v <- value(f)
29+
stopifnot(identical(v, a0))
30+
} ## if (supports_ssh)
31+
32+
message("*** batchtools_ssh() ... DONE")
33+
}
334

4-
message("*** batchtools_ssh() ...")
5-
6-
plan(batchtools_ssh, workers = 2L)
7-
supports_ssh <- tryCatch({
8-
f <- future(42L)
9-
v <- value(f)
10-
identical(v, 42L)
11-
}, error = function(e) FALSE)
12-
message("Supports batchtools_ssh: ", supports_ssh)
13-
14-
if (supports_ssh) {
15-
message("future(a) ...")
16-
a0 <- a <- 42
17-
f <- future(a)
18-
stopifnot(identical(f$globals$a, a0))
19-
v <- value(f)
20-
stopifnot(identical(v, a0))
21-
22-
message("future(a, lazy = TRUE) ...")
23-
a0 <- a <- 42
24-
f <- future(a, lazy = TRUE)
25-
rm(list = "a")
26-
stopifnot(identical(f$globals$a, a0))
27-
v <- value(f)
28-
stopifnot(identical(v, a0))
29-
} ## if (supports_ssh)
30-
31-
message("*** batchtools_ssh() ... DONE")
3235

0 commit comments

Comments
 (0)