Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
philchalmers committed Dec 4, 2024
1 parent 1491a1c commit 395507f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/tests/test-03-array.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ test_that('array', {
generate=Generate, analyse=Analyse,
summarise=Summarise, arrayID=arrayID,
iseed=iseed, filename='mysim',
control=list(store_Random.seeds=TRUE))
control=list(store_Random.seeds=TRUE), verbose=FALSE)
results <- SimExtract(res, what='results') # condition and replication count stored
expect_equal(results$condition[1], 1)
expect_equal(results$arrayID[1], 1)
Expand All @@ -85,7 +85,7 @@ test_that('array', {
runArraySimulation(design=Design5, replications=10,
generate=Generate, analyse=Analyse,
summarise=Summarise, iseed=iseed,
filename='mylongsim', arrayID=arrayID)
filename='mylongsim', arrayID=arrayID, verbose=FALSE)

res <- readRDS('mylongsim-14.rds')
results <- SimResults(res) # condition and replication count stored
Expand All @@ -108,7 +108,7 @@ test_that('array', {
generate=Generate, analyse=Analyse_big,
summarise=Summarise, iseed=iseed,
filename='mylongsim', arrayID=arrayID,
control = list(max_RAM="150MB"))
control = list(max_RAM="150MB"), verbose=FALSE)
res <- readRDS("mylongsim-14.rds")
expect_true(res$REPLICATIONS < 1000L)
SimClean('mylongsim-14.rds')
Expand All @@ -123,7 +123,8 @@ test_that('array', {
generate=Generate, analyse=Analyse,
summarise=Summarise, iseed=iseed, arrayID=arrayID,
dirname='sim', filename='condition', # saved to 'sim/condition-#.rds'
control = list(max_time = "04:00:00", max_RAM = "4GB"))) |> invisible()
control = list(max_time = "04:00:00", max_RAM = "4GB"),
verbose=FALSE)) |> invisible()

# If necessary, conditions above will manually terminate before
# 4 hours, returning any successfully completed results before the HPC
Expand Down Expand Up @@ -167,7 +168,7 @@ test_that('array', {
runArraySimulation(design=Design5, replications=10,
generate=Generate, analyse=Analyse_list,
summarise=Summarise_list, iseed=iseed, arrayID=arrayID,
dirname='sim', filename='condition') |> invisible()
dirname='sim', filename='condition', verbose=FALSE) |> invisible()
res <- readRDS("sim/condition-1.rds")
results <- SimExtract(res, 'results')
expect_true(is.list(results))
Expand All @@ -181,7 +182,7 @@ test_that('array', {
runArraySimulation(design=Design5, replications=10,
generate=Generate, analyse=Analyse_list,
summarise=Summarise_list, iseed=iseed, arrayID=arrayID,
dirname='sim', filename='condition')) |> invisible()
dirname='sim', filename='condition', verbose=FALSE)) |> invisible()

files <- dir('sim/')
expect_true(all(files %in% paste0('condition-', 1:nrow(Design5), '.rds')))
Expand Down

0 comments on commit 395507f

Please sign in to comment.