Skip to content

Commit f064846

Browse files
TESTS: Assert that plan() accepts argument interrupts
1 parent d2fe9ee commit f064846

File tree

5 files changed

+46
-5
lines changed

5 files changed

+46
-5
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: future.tests
22
Title: Test Suite for 'Future API' Backends
3-
Version: 0.9.0-9000
3+
Version: 0.9.0-9001
44
Authors@R: c(
55
person("Henrik", "Bengtsson", role = c("aut", "cre", "cph"), email = "[email protected]"),
66
person(family = "The R Consortium", comment = "Project was awarded an Infrastructure Steering Committee (ISC) grant in 2017", role = "fnd"))
@@ -23,5 +23,5 @@ License: LGPL (>= 2.1)
2323
Encoding: UTF-8
2424
URL: https://future.tests.futureverse.org, https://github.com/futureverse/future.tests
2525
BugReports: https://github.com/futureverse/future.tests/issues
26-
RoxygenNote: 7.3.2
26+
RoxygenNote: 7.3.3
2727
Roxygen: list(markdown = TRUE)

NEWS.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# Version (development version)
22

3-
* ...
3+
## New Features
4+
5+
* Add logical R option `future.tests.devel`, which can be set by
6+
environment variable `R_FUTURE_TESTS_DEVEL`. This controls whether
7+
tests "under developement" will be run.
8+
9+
## Test Updates
10+
11+
* Under development:
12+
13+
- Assert that `plan()` accepts argument `interrupts`.
414

515

616
# Version 0.9.0 [2025-04-14]

R/zzz.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
options(future.tests.undo = value)
1313
}
1414

15+
value <- getOption("future.tests.devel")
16+
if (is.null(value)) {
17+
value <- Sys.getenv("R_FUTURE_TESTS_DEVEL", NA_character_)
18+
if (!is.na(value)) {
19+
value <- isTRUE(as.logical(value))
20+
options(future.tests.devel = value)
21+
}
22+
}
23+
1524
args <- parseCmdArgs()
1625
cores <- args$cores
1726
if (is.null(cores)) {

inst/test-db/plan.R

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,22 @@ make_test(title = "plan() - workers=<invalid>", args = list(), tags = c("plan",
109109
print(res)
110110
stopifnot(inherits(res, "error"))
111111
})
112+
113+
114+
make_test(title = "plan() - interrupts = NA/FALSE/TRUE", args = list(), tags = c("plan"), register = getOption("future.tests.devel", FALSE), {
115+
current_plan <- plan()
116+
print(current_plan)
117+
118+
for (interrupts in c(NA, FALSE, TRUE)) {
119+
cat(sprintf("interrupts: %s\n", interrupts))
120+
withCallingHandlers({
121+
if (is.na(interrupts)) {
122+
plan(current_plan)
123+
} else {
124+
plan(current_plan, interrupts = interrupts)
125+
}
126+
}, warning = function(w) {
127+
stop(conditionMessage(w))
128+
})
129+
}
130+
})

pkgdown/_pkgdown.yml.rsp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ home:
2626

2727
navbar:
2828
structure:
29-
right: [futureverse, pkgs, cran, github, lightswitch]
29+
right: [search, futureverse, pkgs, cran, github, lightswitch]
3030
components:
3131
futureverse:
3232
icon: fas fa-home
@@ -41,7 +41,10 @@ navbar:
4141
cran:
4242
icon: fab fa-r-project
4343
href: https://cloud.r-project.org/package=<%= pkg %>
44-
44+
45+
search:
46+
exclude: ['README_ja.md']
47+
4548
template:
4649
params:
4750
docsearch:

0 commit comments

Comments
 (0)