Skip to content

Commit 8a510b6

Browse files
committed
Add kill function to implements remote check
1 parent b0b9955 commit 8a510b6

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

R/remote.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,8 @@ implements_remote <- function(x) {
472472
is.function(x$list_versions) &&
473473
is.function(x$pull) &&
474474
is.function(x$run) &&
475-
is.function(x$url_report)
475+
is.function(x$url_report) &&
476+
is.function(x$kill)
476477
}
477478

478479

R/remote_path.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,9 @@ orderly_remote_path_ <- R6::R6Class(
9696

9797
bundle_import = function(path) {
9898
orderly_bundle_import(path, root = self$config, locate = FALSE)
99+
},
100+
101+
kill = function(...) {
102+
stop("'orderly_remote_path' remotes do not kill")
99103
}
100104
))

tests/testthat/test-remote-path.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,3 +318,11 @@ test_that("bundle pack and import", {
318318

319319
expect_equal(remote$list_versions("example"), ans$id)
320320
})
321+
322+
323+
test_that("orderly_cancel_remote", {
324+
dat <- prepare_orderly_remote_example()
325+
expect_error(
326+
orderly_cancel_remote("example", root = dat$config),
327+
"'orderly_remote_path' remotes do not kill")
328+
})

tests/testthat/test-remote.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ test_that("orderly run remote passes instance to run", {
269269
list_reports = function() TRUE,
270270
list_versions = function() TRUE,
271271
pull = function() TRUE,
272-
url_report = function() TRUE
272+
url_report = function() TRUE,
273+
kill = function() TRUE
273274
)
274275
)
275276

@@ -334,7 +335,8 @@ test_that("orderly run remote passes ref to run", {
334335
list_reports = function() TRUE,
335336
list_versions = function() TRUE,
336337
pull = function() TRUE,
337-
url_report = function() TRUE
338+
url_report = function() TRUE,
339+
kill = function() TRUE
338340
)
339341
)
340342

@@ -379,6 +381,7 @@ test_that("can get status of remote queue", {
379381
pull = function() TRUE,
380382
run = function() TRUE,
381383
url_report = function() TRUE,
384+
kill = function() TRUE,
382385
queue_status = function() mock_status()
383386
)
384387
)

0 commit comments

Comments
 (0)