From d4c064845ebeda7628b64ab9d82c8a0ac908bdcf Mon Sep 17 00:00:00 2001 From: wlandau-lilly Date: Mon, 4 Dec 2023 11:49:27 -0500 Subject: [PATCH] Migrate up to test-class_local.R --- tests/testthat/test-class_future.R | 18 +++++++++--------- tests/testthat/test-class_group.R | 2 +- tests/testthat/test-class_imports.R | 2 +- tests/testthat/test-class_inspection.R | 12 ++++++------ tests/testthat/test-class_local.R | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/testthat/test-class_future.R b/tests/testthat/test-class_future.R index b656ad606..170965050 100644 --- a/tests/testthat/test-class_future.R +++ b/tests/testthat/test-class_future.R @@ -22,8 +22,8 @@ tar_test("workerless deployment works", { pipeline <- pipeline_init(list(x, y, z)) out <- future_init(pipeline) out$run() - built <- names(out$scheduler$progress$built$envir) - expect_equal(built, character(0)) + completed <- names(out$scheduler$progress$completed$envir) + expect_equal(completed, character(0)) }) tar_test("semi-workerless deployment works", { @@ -45,8 +45,8 @@ tar_test("semi-workerless deployment works", { pipeline <- pipeline_init(list(x, y, z)) out <- future_init(pipeline) out$run() - built <- names(out$scheduler$progress$built$envir) - expect_equal(built, character(0)) + completed <- names(out$scheduler$progress$completed$envir) + expect_equal(completed, character(0)) }) tar_test("some targets up to date, some not", { @@ -64,7 +64,7 @@ tar_test("some targets up to date, some not", { pipeline <- pipeline_init(list(x, y)) future <- future_init(pipeline) future$run() - out <- names(future$scheduler$progress$built$envir) + out <- names(future$scheduler$progress$completed$envir) expect_equal(out, "y") value <- target_read_value(pipeline_get_target(pipeline, "y")) expect_equal(value$object, 2L) @@ -87,7 +87,7 @@ tar_test("specialized plans (unstructured resources)", { pipeline <- pipeline_init(list(x, y)) future <- future_init(pipeline) future$run() - out <- sort(names(future$scheduler$progress$built$envir)) + out <- sort(names(future$scheduler$progress$completed$envir)) expect_equal(out, sort(c("x", "y"))) value <- target_read_value(pipeline_get_target(pipeline, "y")) expect_equal(value$object, 1L) @@ -109,7 +109,7 @@ tar_test("future algo can skip targets", { pipeline <- pipeline_init(list(x, y)) future <- future_init(pipeline) future$run() - out <- names(future$scheduler$progress$built$envir) + out <- names(future$scheduler$progress$completed$envir) expect_equal(out, "x") value <- target_read_value(pipeline_get_target(pipeline, "x")) expect_equal(value$object, 1L) @@ -156,8 +156,8 @@ tar_test("branching plan", { expect_equal(skipped, character(0)) out2 <- future_init(pipeline_map(), workers = 2L) out2$run() - built <- names(out2$scheduler$progress$built$envir) - expect_equal(built, character(0)) + completed <- names(out2$scheduler$progress$completed$envir) + expect_equal(completed, character(0)) value <- function(name) { target_read_value(pipeline_get_target(pipeline, name))$object } diff --git a/tests/testthat/test-class_group.R b/tests/testthat/test-class_group.R index 582e775e8..3d76834fa 100644 --- a/tests/testthat/test-class_group.R +++ b/tests/testthat/test-class_group.R @@ -102,7 +102,7 @@ tar_test("group branch invalidation (#507)", { }) tar_make(callr_function = NULL) out <- tar_progress() - out <- out$name[out$progress == "built" & grepl("^y_", out$name)] + out <- out$name[out$progress == "completed" & grepl("^y_", out$name)] expect_equal(length(out), 1L) }) diff --git a/tests/testthat/test-class_imports.R b/tests/testthat/test-class_imports.R index 1f238ec93..180fd101e 100644 --- a/tests/testthat/test-class_imports.R +++ b/tests/testthat/test-class_imports.R @@ -119,6 +119,6 @@ tar_test("imports setting works", { out <- tar_outdated(callr_function = NULL, targets_only = FALSE) expect_true(all(c("f", "g", "x") %in% out)) tar_make(callr_function = NULL) - expect_equal(tar_progress(x)$progress, "built") + expect_equal(tar_progress(x)$progress, "completed") expect_equal(tar_read(x), 3L) }) diff --git a/tests/testthat/test-class_inspection.R b/tests/testthat/test-class_inspection.R index 13d373b99..ca690af59 100644 --- a/tests/testthat/test-class_inspection.R +++ b/tests/testthat/test-class_inspection.R @@ -264,8 +264,8 @@ tar_test("target vertices get progress", { ) lines <- c( "name|progress", - "w|built", - "x|started", + "w|completed", + "x|dispatched", "y|canceled", "z|errored" ) @@ -278,7 +278,7 @@ tar_test("target vertices get progress", { exp <- data_frame( name = c("w", "x", "y", "z"), type = rep("stem", 4L), - status = c("outdated", "started", "canceled", "errored") + status = c("outdated", "dispatched", "canceled", "errored") ) exp <- exp[order(exp$name), ] rownames(vertices) <- NULL @@ -299,8 +299,8 @@ tar_test("turn outdated off", { ) lines <- c( "name|progress", - "w|built", - "x|started", + "w|completed", + "x|dispatched", "y|canceled", "z|errored" ) @@ -313,7 +313,7 @@ tar_test("turn outdated off", { exp <- data_frame( name = c("w", "x", "y", "z"), type = rep("stem", 4L), - status = c("built", "started", "canceled", "errored") + status = c("completed", "dispatched", "canceled", "errored") ) exp <- exp[order(exp$name), ] rownames(vertices) <- NULL diff --git a/tests/testthat/test-class_local.R b/tests/testthat/test-class_local.R index d765c8dd6..0b3044831 100644 --- a/tests/testthat/test-class_local.R +++ b/tests/testthat/test-class_local.R @@ -49,7 +49,7 @@ tar_test("can run on a subset of targets", { pipeline <- pipeline_order() local <- local_init(pipeline, names = c("min1", "max2")) local$run() - out <- counter_get_names(local$scheduler$progress$built) + out <- counter_get_names(local$scheduler$progress$completed) exp <- c("min1", "max2", "data1", "data2") expect_equal(sort(out), sort(exp)) expect_equal(