Skip to content

Commit

Permalink
Checks
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Dec 7, 2023
1 parent 5fb565b commit 47a2547
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 9 deletions.
10 changes: 5 additions & 5 deletions R/crew_aws_batch_monitor.R
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ crew_class_aws_batch_monitor <- R6::R6Class(
memory <- memory * ((5L ^ 9L) / (2L ^ 11L))
}
args <- list()
args$jobDefinitionName = private$.job_definition
args$jobDefinitionName <- private$.job_definition
args$type <- "container"
args$schedulingPriority <- scheduling_priority
args$propagateTags <- propagate_tags
Expand Down Expand Up @@ -304,7 +304,7 @@ crew_class_aws_batch_monitor <- R6::R6Class(
#' revision number of the registered job definition.
#' @param image Character of length 1, Docker image used for each job.
#' You can supply a path to an image in Docker Hub or the full URI
#' of an image in an Amazohn ECR repository.
#' of an image in an Amazon ECR repository.
#' @param memory_units Character of length 1,
#' either `"gigabytes"` or `"mebibytes"` to set the units of the
#' `memory` argument. `"gigabytes"` is simpler for EC2 jobs, but
Expand Down Expand Up @@ -372,8 +372,8 @@ crew_class_aws_batch_monitor <- R6::R6Class(
)
# nocov end
},
#' @description Attempt to deeregister the job definition.
#' @details Attempt to dereregister the job definition whose name was
#' @description Attempt to deregister the job definition.
#' @details Attempt to deregister the job definition whose name was
#' originally supplied to the `job_definition` argument of
#' [crew_aws_batch_monitor()].
#' @return `NULL` (invisibly).
Expand All @@ -395,7 +395,7 @@ crew_class_aws_batch_monitor <- R6::R6Class(
#' @return If the job definition is not active or does not exist,
#' `describe()` returns `NULL`. Otherwise, it returns
#' a `tibble` with job definition information. Some fields
#' may be nested lists.
#' may be nested lists.
describe = function() {
# Covered in tests/interactive/job_definitions.R
# nocov start
Expand Down
5 changes: 4 additions & 1 deletion inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,7 @@ www
ARN
deregister

mebibytes
MiB
nolint
URI
6 changes: 3 additions & 3 deletions man/crew_class_aws_batch_monitor.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions tests/testthat/test-crew_aws_batch_monitor.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,64 @@ test_that("crew_aws_batch_monitor()", {
expect_equal(out$endpoint, "endpoint_url")
expect_equal(out$region, "us-east-2")
})

test_that("crew_aws_batch_monitor() private$.register_args()", {
skip_on_cran()
x <- crew_aws_batch_monitor(
job_definition = "job-definition-name",
job_queue = "crew-aws-batch-job-queue",
region = "us-east-2"
)
out <- x$.__enclos_env__$private$.register_args(
image = "alpine:latest",
platform_capabilities = "EC2",
memory_units = "gigabytes",
memory = 1,
cpus = 1,
gpus = 1,
seconds_timeout = 600,
scheduling_priority = 3,
tags = c("crew_aws_batch_1", "crew_aws_batch_2"),
propagate_tags = TRUE,
job_role_arn = "job_role_arn_id",
execution_role_arn = "execution_role_arn_id"
)
exp <- list(
jobDefinitionName = "job-definition-name",
type = "container",
schedulingPriority = 3,
propagateTags = TRUE,
platformCapabilities = "EC2",
timeout = list(attemptDurationSeconds = 600),
containerProperties = list(
image = "alpine:latest",
resourceRequirements = list(
memory = list(value = "954", type = "MEMORY"),
cpus = list(
value = "1",
type = "VCPU"
),
gpus = list(
value = "1",
type = "GPU"
)
),
logConfiguration = list(
logDriver = "awslogs",
options = list(
"awslogs-group" = "/aws/batch/job",
"awslogs-region" = "us-east-2",
"awslogs-stream-prefix" = "job-definition-name"
)
)
)
)
expect_equal(out, exp)
})

test_that("crew_aws_batch_monitor() private$.client()", {
skip_on_cran()
x <- crew_aws_batch_monitor(job_queue = "x")
out <- x$.__enclos_env__$private$.client()
expect_true(is.function(out$list_jobs))
})

0 comments on commit 47a2547

Please sign in to comment.