Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
plietar committed Sep 11, 2024
1 parent 4b18893 commit 8799fc2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
1 change: 0 additions & 1 deletion R/outpack_root.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ file_import_archive <- function(root, path, file_path, name, id) {
## some files behind. This does match the behaviour of the file
## store version, but not of orderly.
file_path_dest <- file.path(dest, file_path)
fs::dir_create(dirname(file_path_dest))

## overwrite = FALSE; see assertion above
copy_files(file.path(path, file_path),
Expand Down
3 changes: 2 additions & 1 deletion R/run.R
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ orderly_run <- function(name, parameters = NULL, envir = NULL, echo = TRUE,

if (dat$strict$enabled) {
inputs_info <- NULL
copy_files(file.path(src, entrypoint_filename), path)
copy_files(file.path(src, entrypoint_filename),
file.path(path, entrypoint_filename))
} else {
inputs_info <- copy_resources_implicit(src, path, dat$resources,
dat$artefacts)
Expand Down
20 changes: 9 additions & 11 deletions tests/testthat/test-outpack-config.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ test_that("Can add file_store", {
expect_equal(length(hash_pulled), 3)

dest <- temp_file()
dir.create(dest)
root$dst$files$get(hash_pulled[[1]], dest, TRUE)
root$dst$files$get(hash_pulled[[2]], dest, TRUE)
root$dst$files$get(hash_pulled[[3]], dest, TRUE)
root$dst$files$get(hash_pulled[[1]], file.path(dest, "a"), TRUE)
root$dst$files$get(hash_pulled[[2]], file.path(dest, "b"), TRUE)
root$dst$files$get(hash_pulled[[3]], file.path(dest, "c"), TRUE)

hash_not_pulled <- outpack_metadata_core(id[["a"]], root$dst)$files$hash
expect_error(root$dst$files$get(hash_not_pulled[[1]], dest, TRUE),
"not found in store")
expect_error(
root$dst$files$get(hash_not_pulled[[1]], file.path(dest, "d"), TRUE),
"not found in store")
})


Expand Down Expand Up @@ -144,7 +144,6 @@ test_that("Files will be searched for by hash when adding file store", {
expect_true(root$config$core$use_file_store)

dest <- temp_file()
dir.create(dest)
root$files$get(outpack_metadata_core(id, root)$files$hash, dest, TRUE)
})

Expand Down Expand Up @@ -247,10 +246,9 @@ test_that("Can add archive", {
expect_equal(length(hash), 3)

dest <- temp_file()
dir.create(dest)
root$files$get(hash[[1]], dest, TRUE)
root$files$get(hash[[2]], dest, TRUE)
root$files$get(hash[[3]], dest, TRUE)
root$files$get(hash[[1]], file.path(dest, "a"), TRUE)
root$files$get(hash[[2]], file.path(dest, "b"), TRUE)
root$files$get(hash[[3]], file.path(dest, "c"), TRUE)
})


Expand Down

0 comments on commit 8799fc2

Please sign in to comment.