From 2d7c43fdbb0e32189e91a447828d0db46074b562 Mon Sep 17 00:00:00 2001 From: Eric Scott Date: Fri, 5 Apr 2024 14:50:58 -0700 Subject: [PATCH] add test with crew workers --- tests/testthat/test-geotargets-option.R | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/testthat/test-geotargets-option.R diff --git a/tests/testthat/test-geotargets-option.R b/tests/testthat/test-geotargets-option.R new file mode 100644 index 0000000..9deab95 --- /dev/null +++ b/tests/testthat/test-geotargets-option.R @@ -0,0 +1,22 @@ +# test_that("geotargets_options_get() retrieves options in correct priority", { +# withr::with_envvar( +# +# ) +# }) + +targets::tar_test("options are distributed to workers", { + targets::tar_script({ + options("geotargets.gdal.raster.driver" = "GeoJSON") + targets::tar_option_set( + controller = crew::crew_controller_local(workers = 2) + ) + list( + targets::tar_target( + opt, + getOption("geotargets.gdal.raster.driver") + ) + ) + }) + targets::tar_make() + expect_equal(targets::tar_read(opt), "GeoJSON") +})