Skip to content

Commit

Permalink
Test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
plietar committed May 31, 2024
1 parent d18e99c commit 16685dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions R/validate.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ orderly_validate_archive_packet <- function(id, action, cache, root) {
drop_local_packet(id, root)
} else if (action == "delete") {
drop_local_packet(id, root)
# TODO: replace with fs::dir_delete
unlink(file.path(root$path, root$config$core$path_archive, res$name, id),
recursive = TRUE)
}
Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test-run.R
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ test_that("Can run simple case with dependency", {
envir2 <- new.env()
id2 <- orderly_run_quietly("depends", root = path, envir = envir2)

## Nothing left in drafts
expect_true(is_directory(file.path(path, "draft", "data")))
expect_true(is_directory(file.path(path, "draft", "depends")))
expect_false(file.exists(file.path(path, "draft", "data", id1)))
expect_false(file.exists(file.path(path, "draft", "depends", id2)))

path1 <- file.path(path, "archive", "data", id1)
path2 <- file.path(path, "archive", "depends", id2)

Expand Down

0 comments on commit 16685dd

Please sign in to comment.