Skip to content

Commit

Permalink
migrate testing
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed May 15, 2024
1 parent c57cdfc commit 3739214
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 113 deletions.
12 changes: 2 additions & 10 deletions R/make.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,7 @@
#' For each target that is still problematic (e.g.
#' `https://github.com/rstudio/gt/issues/297`)
#' you can safely run the command in its own special `callr::r()` process.
#' Example: `https://github.com/rstudio/gt/issues/297#issuecomment-497778735`. # nolint
#'
#' If that fails, you can run `make(plan, lock_envir = FALSE)`
#' to suppress environment-locking for all targets.
#' However, this is not usually recommended.
#' There are legitimate use cases for `lock_envir = FALSE`
#' (example: `https://books.ropensci.org/drake/hpc.html#parallel-computing-within-targets`) # nolint
#' but most workflows should stick with the default `lock_envir = TRUE`.
#'
#' Example: `https://github.com/rstudio/gt/issues/297#issuecomment-497778735`. # nolin
#' @section Cache locking:
#' When `make()` runs, it locks the cache so other processes cannot modify it.
#' Same goes for [outdated()], [vis_drake_graph()], and similar functions
Expand Down Expand Up @@ -169,7 +161,7 @@ make <- function(
memory_strategy = "speed",
layout = NULL,
spec = NULL,
lock_envir = TRUE,
lock_envir = NULL,
history = TRUE,
recover = FALSE,
recoverable = TRUE,
Expand Down
6 changes: 2 additions & 4 deletions tests/testthat/helper-testrun.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ testrun <- function(config) {
lazy_load = config$settings$lazy_load,
session_info = config$settings$session_info,
fetch_cache = config$fetch_cache,
caching = config$caching,
lock_envir = !any(grepl("staged", config$settings$parallelism))
caching = config$caching
)
)
}
Expand All @@ -38,8 +37,7 @@ testconfig <- function(config) {
lazy_load = config$settings$lazy_load,
session_info = config$settings$session_info,
fetch_cache = config$fetch_cache,
caching = config$caching,
lock_envir = !any(grepl("staged", config$settings$parallelism))
caching = config$caching
)
out$plan <- config$plan
out$targets <- config$targets
Expand Down
3 changes: 1 addition & 2 deletions tests/testthat/test-2-build.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ test_with_dir("drake_build() works as expected", {
con <- drake_config(
plan = pl,
session_info = FALSE,
envir = e,
lock_envir = TRUE
envir = e
)
# can run before any make()
o <- drake_build_impl(
Expand Down
97 changes: 0 additions & 97 deletions tests/testthat/test-2-lock.R

This file was deleted.

0 comments on commit 3739214

Please sign in to comment.