Skip to content

Commit 1c5763d

Browse files
TESTS: Use plan(<pkg>::<name>) in tests
1 parent bd335d6 commit 1c5763d

24 files changed

+58
-77
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-9936
2+
Version: 0.12.2-9937
33
Depends:
44
R (>= 3.2.0),
55
parallelly,

inst/testme/test-BatchtoolsFuture,gc.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
library(future.batchtools)
1+
library(future)
22

33
message("*** BatchtoolsFuture() and garbage collection ...")
44

5-
plan(batchtools_local)
5+
plan(future.batchtools::batchtools_local)
66

77
for (how in c("resolve", "value")) {
88
f <- future({ 1 })

inst/testme/test-BatchtoolsFuture.R

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
library(future.batchtools)
1+
library(future)
22

33
message("*** BatchtoolsFuture() ...")
44

55
message("*** BatchtoolsFuture() - cleanup ...")
66

7-
plan(batchtools_local)
7+
plan(future.batchtools::batchtools_local)
88

99
f <- future({ 1L })
1010
res <- await(f, cleanup = TRUE)
@@ -57,27 +57,11 @@ stopifnot(inherits(res, "error"))
5757

5858
message("*** BatchtoolsFuture() - registry exceptions ... DONE")
5959

60-
message("*** BatchtoolsFuture() - exceptions ...")
61-
62-
res <- try(plan(batchtools_local, workers = integer(0)), silent = TRUE)
63-
print(res)
64-
stopifnot(inherits(res, "try-error"))
65-
66-
res <- try(plan(batchtools_local, workers = 0L), silent = TRUE)
67-
print(res)
68-
stopifnot(inherits(res, "try-error"))
69-
70-
res <- try(plan(batchtools_local, workers = TRUE), silent = TRUE)
71-
print(res)
72-
stopifnot(inherits(res, "try-error"))
73-
74-
message("*** BatchtoolsFuture() - exceptions ... DONE")
75-
7660

7761
message("*** BatchtoolsFuture() - timeout ...")
7862

7963
if (fullTest && availableCores(constraints = "multicore") > 1) {
80-
plan(batchtools_multicore)
64+
plan(future.batchtools::batchtools_multicore)
8165

8266
options(future.wait.timeout = 0.15, future.wait.interval = 0.1)
8367

@@ -96,6 +80,4 @@ if (fullTest && availableCores(constraints = "multicore") > 1) {
9680
message("*** BatchtoolsFuture() - timeout ... DONE")
9781

9882

99-
10083
message("*** BatchtoolsFuture() ... DONE")
101-

inst/testme/test-BatchtoolsFutureError.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
library(future.batchtools)
1+
library(future)
22

33
message("*** BatchtoolsFutureError() ...")
44

5-
plan(batchtools_local)
5+
plan(future.batchtools::batchtools_local)
66

77
for (cleanup in c(FALSE, TRUE)) {
88
mprintf("*** batchtools future error w/ future.delete = %s ...\n", cleanup)
@@ -54,7 +54,7 @@ for (cleanup in c(FALSE, TRUE)) {
5454

5555

5656
message("*** BatchtoolsFuture - expired ...")
57-
plan(batchtools_local)
57+
plan(future.batchtools::batchtools_local)
5858
msg <- "Abruptly terminating the future!"
5959
f <- future({
6060
cat(file = stderr(), msg)
@@ -74,7 +74,7 @@ message("*** BatchtoolsFuture - expired ... done")
7474
if (fullTest) {
7575
message("*** BatchtoolsFuture - deleting running ...")
7676

77-
plan(batchtools_multicore)
77+
plan(future.batchtools::batchtools_multicore)
7878

7979
f <- future({
8080
Sys.sleep(2)

inst/testme/test-batchtools_bash.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#' @tags batchtools_bash
33

44
library(future)
5-
library(listenv)
65

76
message("*** batchtools_bash() ...")
87

inst/testme/test-batchtools_custom.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
library(future.batchtools)
1+
library(future)
22
library(batchtools)
33
library(listenv)
44

55
message("*** batchtools_custom() ...")
66

77
message("*** batchtools_custom() w/ 'conf.file' on R_BATCHTOOLS_SEARCH_PATH")
88

9-
plan(batchtools_custom)
9+
plan(future.batchtools::batchtools_custom)
1010

1111
f <- future({
1212
42L
@@ -22,7 +22,7 @@ message("*** batchtools_custom() w/ 'cluster.functions' without globals")
2222

2323
cf <- makeClusterFunctionsInteractive(external = TRUE)
2424
str(cf)
25-
plan(batchtools_custom, cluster.functions = cf)
25+
plan(future.batchtools::batchtools_custom, cluster.functions = cf)
2626

2727
f <- future({
2828
42L

inst/testme/test-batchtools_hpc.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
library(future)
12
library(future.batchtools)
23

34
## Setup all strategies including custom once for testing on HPC environments

inst/testme/test-batchtools_interactive.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
library(future.batchtools)
1+
library(future)
22
library(listenv)
33

44
message("*** batchtools_interactive() ...")
55

66
message("*** batchtools_interactive() without globals")
77

8-
plan(batchtools_interactive)
8+
plan(future.batchtools::batchtools_interactive)
99

1010
f <- future({
1111
42L

inst/testme/test-batchtools_local.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
library(future.batchtools)
1+
library(future)
22
library(listenv)
33

44
message("*** batchtools_local() ...")
55

66
message("*** batchtools_local() without globals")
77

8-
plan(batchtools_local)
8+
plan(future.batchtools::batchtools_local)
99

1010
f <- future({
1111
42L

inst/testme/test-batchtools_multicore.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
library(future.batchtools)
1+
library(future)
22
library(listenv)
33

44
message("*** batchtools_multicore() ...")
@@ -14,7 +14,7 @@ for (cores in 1:min(2L, availableCores("multicore"))) {
1414
mprintf("batchtools multicore futures are not supporting on '%s'. Falling back to use synchroneous batchtools local futures\n", .Platform$OS.type) #nolint
1515
}
1616

17-
plan(batchtools_multicore, workers = cores)
17+
plan(future.batchtools::batchtools_multicore, workers = cores)
1818

1919
for (globals in c(FALSE, TRUE)) {
2020
mprintf("*** batchtools_multicore(..., globals = %s) without globals\n",
@@ -78,7 +78,7 @@ for (cores in 1:min(2L, availableCores("multicore"))) {
7878
if (cores > 1) {
7979
message("*** batchtools_multicore(..., workers = 1L) ...")
8080

81-
plan(batchtools_multicore, workers = 1L)
81+
plan(future.batchtools::batchtools_multicore, workers = 1L)
8282

8383
a <- 2
8484
b <- 3
@@ -99,7 +99,7 @@ for (cores in 1:min(2L, availableCores("multicore"))) {
9999

100100

101101
mprintf("*** batchtools_multicore() and errors\n")
102-
plan(batchtools_multicore)
102+
plan(future.batchtools::batchtools_multicore)
103103

104104
f <- future({
105105
stop("Whoops!")

0 commit comments

Comments
 (0)