Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/lambda-util.R
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ add_lambda_to_eventridge <-
aws_event <- aws_connect("eventbridge")
aws_event$put_targets(
Rule = rule_name,
Targets = list(list(Id = 1, Arn = lambda_function_arn))
Targets = list(list(Id = "1", Arn = lambda_function_arn))
)
logger::log_debug("[add_lambda_to_eventridge] Done.")
}
13 changes: 13 additions & 0 deletions tests/testthat/test-aws-lookups.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ test_that("schedule_lambda builds valid rule and statement names", {
expect_match(statement, "^[A-Za-z0-9_-]+$")
})

test_that("add_lambda_to_eventridge sends the target ID as a string", {
targets <- NULL
local_mocked_bindings(
aws_connect = function(service) {
list(put_targets = function(Rule, Targets) {
targets <<- Targets
})
}
)
add_lambda_to_eventridge("a_rule", "arn:fn")
expect_type(targets[[1]]$Id, "character")
})

test_that("test_lambda finds the image by tag and removes the container", {
calls <- list()
local_mocked_bindings(
Expand Down
Loading