Changelog
Source:NEWS.md
Version (development version)
Test Updates
Now asserting that immediate conditions are relayed, where possible.
The test for
cancel()andvalue()now asserts thatvalue()on a canceled future signals aFutureCanceledError, which inherits fromFutureInterruptError, also when canceled withinterrupt = FALSE, when the backend does not support interrupts, and for lazy futures. A new test asserts the same for a future that has already been collected. The new assertions are skipped when testing against a version of the future package that does not yet include the corresponding bug fix.-
Add tests for
value()on lists of futures asserting that (i) argumentinitofreduce, and argumentsstdoutandsignal, are respected also withinorder = FALSE, (ii) an error cancels and resolves the remaining futures, without launching lazy ones,(iii) a future that returns an error object is not mistaken for a failed future, and (iv) standard output and messages of all futures are relayed in order also with
drop = TRUE. Add test asserting that
futureCall()passes language objects, e.g. symbols and calls, in argumentargsas-is toFUN.The above tests are skipped when testing against a version of the future package that does not yet include the corresponding bug fix.
-
Add tests for (i) globals specified as a character vector with attributes
addandignore, (ii) unused variables not being exported as globals, (iii) a global...together with a global...future.FUN(), (iv) switching plan while a future is running,(v) repeated
value()on an interrupted future, (vi) launching many futures without leaving unused connections behind, (vii) immediate conditions not being re-signaled, and (viii)makeClusterFuture()passing language objects as-is and supportingclusterEvalQ()that only attaches packages. Add tests for (i)
future(..., packages = "missing-package")signaling an error, (ii)value(<listenv>, idxs), (iii)value(<list>, reduce = structure("+", init = 42)), (iv)result()on a canceled and interrupted future, and (v) errors from amakeClusterFuture()cluster being signaled as by other clusters.
New Features
check()gained argumentindexand command-line option--test-index=<index>for running a subset of the tests by their numbers, e.g.--test-index=42and--test-index=2:13,14.run_tests()gained argumenttimeout.
Bug Fixes
run_test()recorded and restored the variables of its own call frame instead of those of the environment where the test is evaluated, so variables created by a test withlocal = FALSEwere never removed.When the future plan could not be restored after a test, an obscure ‘invalid argument type’ error message was produced instead of reporting that the plan differed.
run_test()would use a function as the value of a missing test argument when a function of the same name existed, e.g.stdout(), instead of reporting the argument as missing.evaluate_expr()andrun_test()would fail with a ‘reached elapsed time limit’ error when a test timed out.check()failed to set the future plan when the specified plan contained the word “plan”, e.g.--test-plan=planned::foo.subset_tests(args, defaults)ignored the arguments of the tests.along_test_plans()dropped errors andNULLresults. Errors are now returned as the result for the plan, and evaluation continues.check_plan(defaults = list())silently skipped tests without arguments.run_tests(defaults = NULL)failed with an error.make_test()accepted a missing title (NA).check(timeout = <seconds>)no longer leaves optionfuture.tests.timeoutset after returning.check()ignored command-line options--session-infoand--debug.check()produced garbled output with interleaved spinner frames and test titles when standard output or standard error was not a terminal, e.g. when the output was piped or written to a log file. The in-place progress is now only shown when both are terminals, which can be overridden by optionfuture.tests.progress.check_plan()andas.data.frame()for tests coerced character test arguments to factors.
Version 1.0.0
CRAN release: 2026-07-15
New Features
Add logical R option
future.tests.devel, which can be set by environment variableR_FUTURE_TESTS_DEVEL. This controls whether tests with a"devel"(“under development”) tag will be included.check()reports on future version.
Version 0.8.0
CRAN release: 2025-03-31
New Features
Now
load_tests()returns a named list, where the names corresponds to the test titles.Now
future.tests::check("mirai::daemons(2); plan(future.mirai::mirai_cluster)")works.
Version 0.7.0
CRAN release: 2023-05-22
Bug Fixes
Tests asserting correctness of
nbrOfWorkers()could produce an “invalid format ‘%d’; use format %f, %e, %g or %a for numeric objects” error when trying to produce an assertion error onnbrOfWorkers()having an incorrect value. This could happen ifnbrOfWorkers()returned a non-integer value, e.g.+Inf.Test asserting that the
workersargument can be a function would not always work if testing with a hardcoded number of workers according toplan().Test asserting that the
workersargument can be a function would not work if the backend’s default value was non-numeric, e.g. theclusterbackend defaults to the character vectorparallelly::availableWorkers().Test asserting that lazy futures would be automatically launched and resolved relied on a legacy version of the Future API, where calling
resolved()on a lazy future could leave it in a lazy state, which is no longer correct. A lazy future will always be launched if one callsresolved()on it.Test asserting that the ff package worked across multiple futures assumed that the package is loaded automatically by the future, which it is not. The could cause the test to fail for some future backends.
Version 0.6.0
CRAN release: 2023-03-11
New Features
Now tests can be formally skipped by calling
future.tests::skip_test()from within the test. Skipped tests are counted and reported in the summary.Now
check_plan()outputs the reason for a test being skipped.Now
check_plan()outputs also the error message, error class, the call, and any standard output, whenever there is a test error.Now
check_plan()outputs also the test iteration index.Added
Rscript -e future.tests::check --version.
Bug Fixes
- Some tests assume that the future strategy tested has a
workersargument, which is not true for all future backends. For example, ‘sequential’ does not take argumentworkers. Previously, we avoided this problem by only testing if the evaluator inheritedmultiprocess, but that is not sufficient, e.g. upcomingfuture.redis::redisinheritsmultiprocess, but still does not have aworkersargument. Now we check for theworkersargument instead.
Version 0.4.0
CRAN release: 2022-11-22
Tests Updates
Assert that
rm(a)in a future expression only removes a local variablea, but never a global variablea.Assert that packages data.table and ff are not affected when a future resets the R options on the worker when resolved.
Assert that a global that is a copy of a non-exported package object (e.g.
utils:::str2logical()) is not dropped because it belongs to a package namespace.Assert that
...can be exported as a global to a future, and used as-is inside a function that does not have...arguments.
New Features
check()andcheck_plan()gained argumentlocal, which is passed down torun_test().check()gained argumentenvir, which is passed down torun_test().
Bug Fixes
The TestResult class did not record whether the test was evaluated in a local environment or not.
A too strict internal assertion would give
Error in evaluate_expr(test$expr, envir = envir, local = FALSE, output = output, : identical(Sys.getenv(), old$envvars) is not TRUEfor R 4.2.x and R-devel on MS Windows. This was because it is not possible to remove environment variables on MS Windows; they can only be set to an empty value.
Version 0.3.0
CRAN release: 2021-10-10
Tests Updates
Assert that
future()doesn’t change the RNG kind.Assert that
future(..., conditions = character(0L))muffles all conditions.
New Features
For robustness, using explicit
stringsAsFactors = FALSEinternally.evaluate_expr(), which is used for running all tests, now reset options, environment variables, the RNG kind, and the random seed afterward to what it was before being called.Added package vignettes.
Version 0.2.1
CRAN release: 2020-03-20
CRAN Re-submission Requests
Update the package description to use single quotes.
Add example to
check().