Skip to content

Commit 020098e

Browse files
committed
Migrate tests
1 parent 3739214 commit 020098e

13 files changed

+22
-54
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Depends:
106106
Imports:
107107
base64url,
108108
digest (>= 0.6.21),
109-
igraph,
109+
igraph (>= 2.0.0),
110110
methods,
111111
parallel,
112112
rlang (>= 0.2.0),

NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ importFrom(igraph,make_empty_graph)
429429
importFrom(igraph,set_vertex_attr)
430430
importFrom(igraph,simplify)
431431
importFrom(igraph,topo_sort)
432+
importFrom(igraph,union)
432433
importFrom(igraph,vertex_attr)
433434
importFrom(methods,new)
434435
importFrom(methods,setRefClass)

R/create_drake_graph.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ cdg_transitive_edges <- function(vertex, edges, args) {
9292
cdg_finalize_graph <- function(edges, targets, args) {
9393
args$logger$disk("finalize graph edges")
9494
file_out <- edges$to[edges$from %in% targets & is_encoded_path(edges$to)]
95-
to <- union(targets, file_out)
95+
to <- base::union(targets, file_out)
9696
args$logger$disk("create igraph")
9797
graph <- igraph::graph_from_data_frame(edges)
9898
args$logger$disk("trim neighborhoods")

R/drake_plan.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ drake_bind_rows <- function(...) {
358358
flatten_df_list(args, df_env = df_env)
359359
dfs <- df_env$dfs
360360
cols <- lapply(dfs, colnames)
361-
cols <- Reduce(f = union, x = cols)
361+
cols <- Reduce(f = base::union, x = cols)
362362
dfs <- lapply(dfs, fill_cols, cols = cols)
363363
do.call(rbind, dfs)
364364
}

R/dynamic.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ register_in_graph <- function(target, subtargets, config) {
297297
name = "imported",
298298
value = FALSE
299299
)
300-
config$envir_graph$graph <- igraph::graph.union(
300+
config$envir_graph$graph <- igraph::union(
301301
config$envir_graph$graph,
302302
subgraph
303303
)

R/make.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
#' For each target that is still problematic (e.g.
5454
#' `https://github.com/rstudio/gt/issues/297`)
5555
#' you can safely run the command in its own special `callr::r()` process.
56-
#' Example: `https://github.com/rstudio/gt/issues/297#issuecomment-497778735`. # nolin
56+
#' Example: `https://github.com/rstudio/gt/issues/297#issuecomment-497778735`. # nolint
5757
#' @section Cache locking:
5858
#' When `make()` runs, it locks the cache so other processes cannot modify it.
5959
#' Same goes for [outdated()], [vis_drake_graph()], and similar functions
@@ -397,7 +397,7 @@ drake_set_session_info <- function(
397397
#' })
398398
#' }
399399
do_prework <- function(config, verbose_packages) {
400-
for (package in union(c("methods", "drake"), config$packages)) {
400+
for (package in base::union(c("methods", "drake"), config$packages)) {
401401
expr <- as.call(c(
402402
quote(require),
403403
package = package,

R/package.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#' @importFrom igraph adjacent_vertices as_ids components delete_vertices
4949
#' degree gorder graph_from_adjacency_matrix igraph_opt igraph_options
5050
#' induced_subgraph is_dag make_empty_graph make_ego_graph set_vertex_attr
51-
#' simplify topo_sort V vertex_attr
51+
#' simplify topo_sort union V vertex_attr
5252
#' @importFrom methods new setRefClass
5353
#' @importFrom parallel mclapply
5454
#' @importFrom rlang dots_list enquo eval_tidy expr quo_squash quos trace_back

R/predict_runtime.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ register_subtargets_graph2 <- function(target, subtargets, config) {
299299
name = "imported",
300300
value = FALSE
301301
)
302-
config$graph <- igraph::graph.union(config$graph, subgraph)
302+
config$graph <- igraph::union(config$graph, subgraph)
303303
config
304304
}
305305

man/make.Rd

+2-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-1-interactive.R

-16
Original file line numberDiff line numberDiff line change
@@ -276,22 +276,6 @@ test_with_dir("clustermq error messages get back to main", {
276276
})
277277
}
278278

279-
if (FALSE) {
280-
test_with_dir("forks + lock_envir = informative warning msg", {
281-
skip_on_cran()
282-
# Don't run this test for real because (1) we would have to add
283-
# furrr to "Suggests" and (2) at some point, base R may be patched
284-
# so forking in the parallel package does not give this warning anyway.
285-
# Also, it needs to run outside the RStudio IDE so we can fork processes.
286-
regexp <- "workaround"
287-
plan <- drake_plan(x = parallel::mclapply(1:2, identity, mc.cores = 2))
288-
expect_warning(
289-
make(plan, envir = globalenv(), lock_envir = TRUE),
290-
regexp = regexp
291-
)
292-
})
293-
}
294-
295279
if (FALSE) {
296280
test_with_dir("clean() in interactive mode", {
297281
skip_on_cran()

tests/testthat/test-8-cache.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ test_with_dir("cache log files, gc, and make()", {
817817

818818
test_with_dir("try_build() does not need to access cache", {
819819
skip_on_cran() # CRAN gets essential tests only (check time limits).
820-
config <- drake_config(drake_plan(x = 1), lock_envir = FALSE)
820+
config <- drake_config(drake_plan(x = 1))
821821
meta <- drake_meta_(target = "x", config = config)
822822
config$cache <- config$settings$cache_log_file <- NULL
823823
build <- try_build(target = "x", meta = meta, config = config)

tests/testthat/test-9-clustermq.R

+5-10
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ test_with_dir("clustermq parallelism", {
4545
caching = caching,
4646
envir = e,
4747
verbose = 1L,
48-
garbage_collection = TRUE,
49-
lock_envir = TRUE
48+
garbage_collection = TRUE
5049
)
5150
expect_equal(outdated_impl(config), character(0))
5251
make(
@@ -55,8 +54,7 @@ test_with_dir("clustermq parallelism", {
5554
jobs = jobs,
5655
caching = caching,
5756
envir = e,
58-
verbose = 1L,
59-
lock_envir = TRUE
57+
verbose = 1L
6058
)
6159
expect_equal(justbuilt(config), character(0))
6260
e$my_plan$command[[2]] <- as.call(
@@ -68,8 +66,7 @@ test_with_dir("clustermq parallelism", {
6866
jobs = jobs,
6967
caching = caching,
7068
envir = e,
71-
verbose = 1L,
72-
lock_envir = TRUE
69+
verbose = 1L
7370
)
7471
expect_equal(justbuilt(config), "small")
7572
clean(small, cache = config$cache)
@@ -79,8 +76,7 @@ test_with_dir("clustermq parallelism", {
7976
jobs = jobs,
8077
caching = caching,
8178
envir = e,
82-
verbose = 1L,
83-
lock_envir = TRUE
79+
verbose = 1L
8480
)
8581
expect_equal(justbuilt(config), "small")
8682
}
@@ -172,8 +168,7 @@ test_with_dir("Start off with non-HPC targets, then go to HPC targets.", {
172168
jobs = jobs,
173169
envir = e,
174170
verbose = 1L,
175-
garbage_collection = TRUE,
176-
lock_envir = TRUE
171+
garbage_collection = TRUE
177172
)
178173
config <- drake_config(e$my_plan, envir = e)
179174
expect_equal(sort(justbuilt(config)), sort(e$my_plan$target))

tests/testthat/test-9-future.R

+5-10
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ test_with_dir("future package functionality", {
3030
caching = caching[i],
3131
jobs = 1,
3232
verbose = 0L,
33-
session_info = FALSE,
34-
lock_envir = TRUE
33+
session_info = FALSE
3534
)
3635
config <- drake_config(
3736
e$my_plan,
@@ -40,8 +39,7 @@ test_with_dir("future package functionality", {
4039
caching = caching[i],
4140
jobs = 1,
4241
verbose = 0L,
43-
session_info = FALSE,
44-
lock_envir = TRUE
42+
session_info = FALSE
4543
)
4644
expect_equal(
4745
outdated_impl(config),
@@ -57,8 +55,7 @@ test_with_dir("future package functionality", {
5755
caching = caching[i],
5856
jobs = 1,
5957
verbose = 0L,
60-
session_info = FALSE,
61-
lock_envir = TRUE
58+
session_info = FALSE
6259
)
6360
expect_equal(justbuilt(config), "small")
6461
}
@@ -72,8 +69,7 @@ test_with_dir("future package functionality", {
7269
caching = caching[i],
7370
jobs = 1,
7471
verbose = 0L,
75-
session_info = FALSE,
76-
lock_envir = TRUE
72+
session_info = FALSE
7773
)
7874
config <- drake_config(
7975
e$my_plan,
@@ -82,8 +78,7 @@ test_with_dir("future package functionality", {
8278
caching = caching[i],
8379
jobs = 1,
8480
verbose = 0L,
85-
session_info = FALSE,
86-
lock_envir = TRUE
81+
session_info = FALSE
8782
)
8883
nobuild(config)
8984
}

0 commit comments

Comments
 (0)