From 2c29601d27100a852bb1bf3ba044f08861236b4e Mon Sep 17 00:00:00 2001 From: Nick-Eagles Date: Thu, 28 Sep 2023 11:50:21 -0400 Subject: [PATCH] Adapt unit tests to SLURM. Also add a test for valid memory request --- tests/testthat/test-job_single.R | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/testthat/test-job_single.R b/tests/testthat/test-job_single.R index 3e2ca88..50d6cfb 100644 --- a/tests/testthat/test-job_single.R +++ b/tests/testthat/test-job_single.R @@ -20,12 +20,8 @@ test_that("job_single", { expect_error(run_test(email = "hello"), "'email' should be one of") expect_error(run_test(logdir = "/logs"), "relative path") expect_error(run_test(cores = 0.5), "should be at least 1") - expect_equal(grep("pe local", run_test(cores = 1)), integer(0)) - expect_equal(grepl("#\\$ -pe local 10", run_test(cores = 10)), TRUE) - expect_equal(grep("shared", run_test(queue = "shared")), integer(0)) - expect_equal(grepl( - "#\\$ -l bluejay,", - run_test(queue = " bluejay ", create_shell = TRUE) - ), TRUE) - expect_error(run_test(FALSE, create_shell = TRUE), "already exists!") + expect_error(run_test(memory = 10), "invalid memory request") + expect_error(run_test(memory = "5GB"), "invalid memory request") + run_test() + expect_error(run_test(delete = FALSE, create_shell = TRUE), "already exists!") })