Skip to content

Commit

Permalink
Migrate aws tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Dec 4, 2023
1 parent 5d13b9a commit 55ccd96
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions tests/aws/test-aws_endpoint.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ tar_test("aws qs format invalidation", {
expr <- tar_tidy_eval(expr, environment(), TRUE)
eval(as.call(list(`tar_script`, expr, ask = FALSE)))
tar_make(callr_function = NULL, reporter = "silent")
expect_equal(tar_progress(x)$progress, "built")
expect_equal(tar_progress(y)$progress, "built")
expect_equal(tar_progress(x)$progress, "completed")
expect_equal(tar_progress(y)$progress, "completed")
tar_make(callr_function = NULL, reporter = "silent")
progress <- tar_progress()
progress <- progress[progress$progress != "skipped", ]
Expand All @@ -123,8 +123,8 @@ tar_test("aws qs format invalidation", {
expr <- tar_tidy_eval(expr, environment(), TRUE)
eval(as.call(list(`tar_script`, expr, ask = FALSE)))
tar_make(callr_function = NULL, reporter = "silent")
expect_equal(tar_progress(x)$progress, "built")
expect_equal(tar_progress(y)$progress, "built")
expect_equal(tar_progress(x)$progress, "completed")
expect_equal(tar_progress(y)$progress, "completed")
expect_equal(tar_read(x), "x_value2")
expect_equal(tar_read(y), c("x_value2", "y_value"))
})
12 changes: 6 additions & 6 deletions tests/aws/test-aws_meta.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ tar_test("AWS meta", {
}, env = list(bucket_name = bucket_name))
do.call(tar_script, list(code = code))
tar_make(reporter = "silent")
expect_true(all(tar_progress()$progress == "built"))
expect_true(all(tar_progress()$progress == "completed"))
expect_equal(tar_read(c), 2L)
for (file in c("meta", "process", "progress", "crew")) {
expect_true(
Expand Down Expand Up @@ -107,7 +107,7 @@ tar_test("AWS tar_meta_delete()", {
}, env = list(bucket_name = bucket_name))
do.call(tar_script, list(code = code))
tar_make(reporter = "silent")
expect_true(all(tar_progress()$progress == "built"))
expect_true(all(tar_progress()$progress == "completed"))
expect_equal(tar_read(c), 2L)
for (file in c("meta", "process", "progress", "crew")) {
expect_true(
Expand Down Expand Up @@ -180,7 +180,7 @@ tar_test("AWS tar_meta_upload()", {
}, env = list(bucket_name = bucket_name))
do.call(tar_script, list(code = code))
tar_make(reporter = "silent")
expect_true(all(tar_progress()$progress == "built"))
expect_true(all(tar_progress()$progress == "completed"))
expect_equal(tar_read(c), 2L)
for (file in c("meta", "process", "progress", "crew")) {
expect_true(
Expand Down Expand Up @@ -245,7 +245,7 @@ tar_test("AWS tar_meta_download()", {
}, env = list(bucket_name = bucket_name))
do.call(tar_script, list(code = code))
tar_make(reporter = "silent")
expect_true(all(tar_progress()$progress == "built"))
expect_true(all(tar_progress()$progress == "completed"))
expect_equal(tar_read(c), 2L)
for (file in c("meta", "process", "progress", "crew")) {
expect_true(
Expand Down Expand Up @@ -298,7 +298,7 @@ tar_test("AWS tar_meta_sync() upload", {
}, env = list(bucket_name = bucket_name))
do.call(tar_script, list(code = code))
tar_make(reporter = "silent")
expect_true(all(tar_progress()$progress == "built"))
expect_true(all(tar_progress()$progress == "completed"))
expect_equal(tar_read(c), 2L)
for (file in c("meta", "process", "progress", "crew")) {
expect_true(
Expand Down Expand Up @@ -363,7 +363,7 @@ tar_test("AWS tar_meta_sync() download", {
}, env = list(bucket_name = bucket_name))
do.call(tar_script, list(code = code))
tar_make(reporter = "silent")
expect_true(all(tar_progress()$progress == "built"))
expect_true(all(tar_progress()$progress == "completed"))
expect_equal(tar_read(c), 2L)
for (file in c("meta", "process", "progress", "crew")) {
expect_true(
Expand Down
8 changes: 4 additions & 4 deletions tests/aws/test-class_aws_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ tar_test("aws_file format invalidation", {
expr <- tar_tidy_eval(expr, environment(), TRUE)
eval(as.call(list(`tar_script`, expr, ask = FALSE)))
tar_make(callr_function = NULL, envir = tar_option_get("envir"))
expect_equal(tar_progress(x)$progress, "built")
expect_equal(tar_progress(y)$progress, "built")
expect_equal(tar_progress(x)$progress, "completed")
expect_equal(tar_progress(y)$progress, "completed")
tar_make(callr_function = NULL)
progress <- tar_progress()
progress <- progress[progress$progress != "skipped", ]
Expand Down Expand Up @@ -183,8 +183,8 @@ tar_test("aws_file format invalidation", {
expr <- tar_tidy_eval(expr, environment(), TRUE)
eval(as.call(list(`tar_script`, expr, ask = FALSE)))
tar_make(callr_function = NULL, envir = tar_option_get("envir"))
expect_equal(tar_progress(x)$progress, "built")
expect_equal(tar_progress(y)$progress, "built")
expect_equal(tar_progress(x)$progress, "completed")
expect_equal(tar_progress(y)$progress, "completed")
expect_equal(tar_read(y), "x_lines2")
unlink("example_aws_file.txt")
aws_s3_delete_bucket(bucket_name)
Expand Down
14 changes: 7 additions & 7 deletions tests/aws/test-class_aws_qs.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ tar_test("aws_qs format invalidation", {
expr <- tar_tidy_eval(expr, environment(), TRUE)
eval(as.call(list(`tar_script`, expr, ask = FALSE)))
tar_make(callr_function = NULL)
expect_equal(tar_progress(x)$progress, "built")
expect_equal(tar_progress(y)$progress, "built")
expect_equal(tar_progress(x)$progress, "completed")
expect_equal(tar_progress(y)$progress, "completed")
tar_make(callr_function = NULL)
progress <- tar_progress()
progress <- progress[progress$progress != "skipped", ]
Expand All @@ -141,8 +141,8 @@ tar_test("aws_qs format invalidation", {
expr <- tar_tidy_eval(expr, environment(), TRUE)
eval(as.call(list(`tar_script`, expr, ask = FALSE)))
tar_make(callr_function = NULL)
expect_equal(tar_progress(x)$progress, "built")
expect_equal(tar_progress(y)$progress, "built")
expect_equal(tar_progress(x)$progress, "completed")
expect_equal(tar_progress(y)$progress, "completed")
expect_equal(tar_read(x), "x_value2")
expect_equal(tar_read(y), c("x_value2", "y_value"))
})
Expand Down Expand Up @@ -487,7 +487,7 @@ tar_test("aws_qs format versioning", {
eval(as.call(list(`tar_script`, expr, ask = FALSE)))
expect_equal(targets::tar_outdated(callr_function = NULL), "x")
tar_make(callr_function = NULL)
expect_equal(tar_progress(x)$progress, "built")
expect_equal(tar_progress(x)$progress, "completed")
first_meta <- tempfile()
file.copy(path_meta(path_store_default()), first_meta)
expect_equal(targets::tar_outdated(callr_function = NULL), character(0))
Expand All @@ -512,7 +512,7 @@ tar_test("aws_qs format versioning", {
eval(as.call(list(`tar_script`, expr, ask = FALSE)))
expect_equal(targets::tar_outdated(callr_function = NULL), "x")
tar_make(callr_function = NULL)
expect_equal(tar_progress(x)$progress, "built")
expect_equal(tar_progress(x)$progress, "completed")
expect_equal(targets::tar_outdated(callr_function = NULL), character(0))
tar_make(callr_function = NULL)
expect_equal(tar_progress(x)$progress, "skipped")
Expand All @@ -539,7 +539,7 @@ tar_test("aws_qs format versioning", {
eval(as.call(list(`tar_script`, expr, ask = FALSE)))
expect_equal(targets::tar_outdated(callr_function = NULL), "x")
tar_make(callr_function = NULL)
expect_equal(tar_progress(x)$progress, "built")
expect_equal(tar_progress(x)$progress, "completed")
})

tar_test("cloud target paths are not in the file path cache", {
Expand Down

0 comments on commit 55ccd96

Please sign in to comment.