diff --git a/tests/testthat/perf_tests/perf_rate.R b/tests/testthat/perf_tests/perf_rate.R index 8d762207c..f9886fa62 100644 --- a/tests/testthat/perf_tests/perf_rate.R +++ b/tests/testthat/perf_tests/perf_rate.R @@ -42,7 +42,7 @@ perf.reference.save <- function(perf.ref.name, rate, tolerance.lower, tolerance.upper) { if (is.null(.perf.reference)) - load.pref() + .load.pref() .perf.reference[nrow(.perf.reference)+1,] <- c(perf.ref.name, rate, tolerance.lower, tolerance.upper) diff --git a/tests/testthat/test-arg-ds.abs.R b/tests/testthat/test-arg-ds.abs.R index fc1e26c33..cfe0a49aa 100644 --- a/tests/testthat/test-arg-ds.abs.R +++ b/tests/testthat/test-arg-ds.abs.R @@ -1,14 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2018-2022 University of Newcastle upon Tyne. All rights reserved. -# Copyright (c) 2022-2025 Arjuna Technologies, Newcastle upon Tyne. All rights reserved. -# -# This program and the accompanying materials -# are made available under the terms of the GNU Public License v3.0. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -#------------------------------------------------------------------------------- - # # Set up # diff --git a/tests/testthat/test-arg-ds.sqrt.R b/tests/testthat/test-arg-ds.sqrt.R index fc5baf37f..ce4248649 100644 --- a/tests/testthat/test-arg-ds.sqrt.R +++ b/tests/testthat/test-arg-ds.sqrt.R @@ -1,14 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2018-2022 University of Newcastle upon Tyne. All rights reserved. -# Copyright (c) 2022-2025 Arjuna Technologies, Newcastle upon Tyne. All rights reserved. -# -# This program and the accompanying materials -# are made available under the terms of the GNU Public License v3.0. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -#------------------------------------------------------------------------------- - # # Set up # diff --git a/tests/testthat/test-perf-ds.Boole.R b/tests/testthat/test-perf-ds.Boole.R index 5e8d198c2..85f936027 100644 --- a/tests/testthat/test-perf-ds.Boole.R +++ b/tests/testthat/test-perf-ds.Boole.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.Boole::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.abs.R b/tests/testthat/test-perf-ds.abs.R index e431c20e8..3e697dc89 100644 --- a/tests/testthat/test-perf-ds.abs.R +++ b/tests/testthat/test-perf-ds.abs.R @@ -21,7 +21,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.abs::perf:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.asCharacter.R b/tests/testthat/test-perf-ds.asCharacter.R index f9c08b7df..86c778c35 100644 --- a/tests/testthat/test-perf-ds.asCharacter.R +++ b/tests/testthat/test-perf-ds.asCharacter.R @@ -20,7 +20,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.asCharacter::perf:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.asDataMatrix.R b/tests/testthat/test-perf-ds.asDataMatrix.R index 329c1e2f6..ef4383239 100644 --- a/tests/testthat/test-perf-ds.asDataMatrix.R +++ b/tests/testthat/test-perf-ds.asDataMatrix.R @@ -20,7 +20,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.asDataMatrix::perf:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.asFactor.R b/tests/testthat/test-perf-ds.asFactor.R index efcb222cc..0d87abda1 100644 --- a/tests/testthat/test-perf-ds.asFactor.R +++ b/tests/testthat/test-perf-ds.asFactor.R @@ -12,7 +12,7 @@ connect.studies.dataset.survival(list("survtime", "time.id", "female", "age.60") # context("ds.asFactor::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.asFactorSimple.R b/tests/testthat/test-perf-ds.asFactorSimple.R index 4d15933c5..57beb82a5 100644 --- a/tests/testthat/test-perf-ds.asFactorSimple.R +++ b/tests/testthat/test-perf-ds.asFactorSimple.R @@ -12,7 +12,7 @@ connect.studies.dataset.survival(list("survtime", "time.id", "female", "age.60") # context("ds.asFactorSimple::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.asInteger.R b/tests/testthat/test-perf-ds.asInteger.R index 2e816320f..1f25fb992 100644 --- a/tests/testthat/test-perf-ds.asInteger.R +++ b/tests/testthat/test-perf-ds.asInteger.R @@ -21,7 +21,7 @@ connect.studies.dataset.cnsim(list("GENDER")) # context("ds.asInteger::perf:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.asList.R b/tests/testthat/test-perf-ds.asList.R index a0f65dda0..783641378 100644 --- a/tests/testthat/test-perf-ds.asList.R +++ b/tests/testthat/test-perf-ds.asList.R @@ -21,7 +21,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.asList::perf:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.asLogical.R b/tests/testthat/test-perf-ds.asLogical.R index f3c4d43d9..8790a82a6 100644 --- a/tests/testthat/test-perf-ds.asLogical.R +++ b/tests/testthat/test-perf-ds.asLogical.R @@ -20,7 +20,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.asLogical::perf:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.asMatrix.R b/tests/testthat/test-perf-ds.asMatrix.R index a07e9605a..6434d75b5 100644 --- a/tests/testthat/test-perf-ds.asMatrix.R +++ b/tests/testthat/test-perf-ds.asMatrix.R @@ -20,7 +20,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.asMatrix::perf:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.asNumeric.R b/tests/testthat/test-perf-ds.asNumeric.R index 33fcf4903..6c0160733 100644 --- a/tests/testthat/test-perf-ds.asNumeric.R +++ b/tests/testthat/test-perf-ds.asNumeric.R @@ -21,7 +21,7 @@ connect.studies.dataset.cnsim(list("GENDER")) # context("ds.asNumeric::perf:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.assign.R b/tests/testthat/test-perf-ds.assign.R index d118eb426..ee551be11 100644 --- a/tests/testthat/test-perf-ds.assign.R +++ b/tests/testthat/test-perf-ds.assign.R @@ -21,7 +21,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.assign::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.boxPlot.R b/tests/testthat/test-perf-ds.boxPlot.R index 12bfcce75..1d799285d 100644 --- a/tests/testthat/test-perf-ds.boxPlot.R +++ b/tests/testthat/test-perf-ds.boxPlot.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.boxPlot::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.boxPlotGG.R b/tests/testthat/test-perf-ds.boxPlotGG.R index d0f9ed101..ac7cfc604 100644 --- a/tests/testthat/test-perf-ds.boxPlotGG.R +++ b/tests/testthat/test-perf-ds.boxPlotGG.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.boxPlotGG::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.c.R b/tests/testthat/test-perf-ds.c.R index 3a39e0cba..d6629d40c 100644 --- a/tests/testthat/test-perf-ds.c.R +++ b/tests/testthat/test-perf-ds.c.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.c::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.cbind.R b/tests/testthat/test-perf-ds.cbind.R index bc682f7a2..7496fe6b3 100644 --- a/tests/testthat/test-perf-ds.cbind.R +++ b/tests/testthat/test-perf-ds.cbind.R @@ -12,7 +12,7 @@ connect.studies.dataset.survival(list("survtime", "time.id", "female", "age.60") # context("ds.cbind::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.changeRefGroup.R b/tests/testthat/test-perf-ds.changeRefGroup.R index 1b9c5ce19..e82913896 100644 --- a/tests/testthat/test-perf-ds.changeRefGroup.R +++ b/tests/testthat/test-perf-ds.changeRefGroup.R @@ -13,7 +13,7 @@ connect.studies.dataset.cnsim(list('PM_BMI_CATEGORICAL')) # context("ds.changeRefGroup::perf::0") test_that("performance", { ds.asFactorSimple("D$PM_BMI_CATEGORICAL", newobj.name="bmi_new") - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.class.R b/tests/testthat/test-perf-ds.class.R index f90927ff4..77d414c54 100644 --- a/tests/testthat/test-perf-ds.class.R +++ b/tests/testthat/test-perf-ds.class.R @@ -21,7 +21,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.class::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.colnames.R b/tests/testthat/test-perf-ds.colnames.R index 7382ecf6e..fede744cb 100644 --- a/tests/testthat/test-perf-ds.colnames.R +++ b/tests/testthat/test-perf-ds.colnames.R @@ -21,7 +21,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.colnames::perf:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.completeCases.R b/tests/testthat/test-perf-ds.completeCases.R index e2aa3667d..3174b19be 100644 --- a/tests/testthat/test-perf-ds.completeCases.R +++ b/tests/testthat/test-perf-ds.completeCases.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2024-2025 Arjuna Technologies, Newcastle upon Tyne. All rights reserved. -# -# This program and the accompanying materials -# are made available under the terms of the GNU Public License v3.0. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -#------------------------------------------------------------------------------- - # # Set up # @@ -21,7 +11,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.completeCases::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.contourPlot.R b/tests/testthat/test-perf-ds.contourPlot.R index 33cb50946..7394d8b34 100644 --- a/tests/testthat/test-perf-ds.contourPlot.R +++ b/tests/testthat/test-perf-ds.contourPlot.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.contourPlot::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.cor.R b/tests/testthat/test-perf-ds.cor.R index eee251ed5..1ffe00572 100644 --- a/tests/testthat/test-perf-ds.cor.R +++ b/tests/testthat/test-perf-ds.cor.R @@ -12,7 +12,7 @@ connect.studies.dataset.survival(list("survtime", "time.id", "female")) # context("ds.cor::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.corTest.R b/tests/testthat/test-perf-ds.corTest.R index 4725f517f..ece7098e7 100644 --- a/tests/testthat/test-perf-ds.corTest.R +++ b/tests/testthat/test-perf-ds.corTest.R @@ -12,7 +12,7 @@ connect.studies.dataset.survival(list("survtime", "time.id")) # context("ds.corTest::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.cov.R b/tests/testthat/test-perf-ds.cov.R index 8272fcd46..49ad2db86 100644 --- a/tests/testthat/test-perf-ds.cov.R +++ b/tests/testthat/test-perf-ds.cov.R @@ -12,7 +12,7 @@ connect.studies.dataset.survival(list("survtime", "time.id", "female")) # context("ds.cov::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.dataFrame.R b/tests/testthat/test-perf-ds.dataFrame.R index 5503eca53..ae1691400 100644 --- a/tests/testthat/test-perf-ds.dataFrame.R +++ b/tests/testthat/test-perf-ds.dataFrame.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_HDL")) # context("ds.dataFrame::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.dataFrameFill.R b/tests/testthat/test-perf-ds.dataFrameFill.R index f8ca43397..4ddc7220b 100644 --- a/tests/testthat/test-perf-ds.dataFrameFill.R +++ b/tests/testthat/test-perf-ds.dataFrameFill.R @@ -12,7 +12,7 @@ connect.discordant.dataset.simple(list("A", "B", "C")) # context("ds.dataFrameFill::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.dataFrameSort.R b/tests/testthat/test-perf-ds.dataFrameSort.R index 9f8a47757..f19d60b80 100644 --- a/tests/testthat/test-perf-ds.dataFrameSort.R +++ b/tests/testthat/test-perf-ds.dataFrameSort.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_HDL")) # context("ds.dataFrameSort::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.dataFrameSubset.R b/tests/testthat/test-perf-ds.dataFrameSubset.R index 46d2cba77..8a5095750 100644 --- a/tests/testthat/test-perf-ds.dataFrameSubset.R +++ b/tests/testthat/test-perf-ds.dataFrameSubset.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_HDL", "PM_BMI_CATEGORICAL")) # context("ds.dataFrameSubset::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.densityGrid.R b/tests/testthat/test-perf-ds.densityGrid.R index bb4c79b1d..4a30e0487 100644 --- a/tests/testthat/test-perf-ds.densityGrid.R +++ b/tests/testthat/test-perf-ds.densityGrid.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.densityGrid::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.dim.R b/tests/testthat/test-perf-ds.dim.R index 3c1179c8f..0ba3c18e8 100644 --- a/tests/testthat/test-perf-ds.dim.R +++ b/tests/testthat/test-perf-ds.dim.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2024-2025 Arjuna Technologies, Newcastle upon Tyne. All rights reserved. -# -# This program and the accompanying materials -# are made available under the terms of the GNU Public License v3.0. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -#------------------------------------------------------------------------------- - # # Set up # @@ -21,7 +11,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.dim::perf::0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.dmtC2S.R b/tests/testthat/test-perf-ds.dmtC2S.R index 689726bef..d65ed0151 100644 --- a/tests/testthat/test-perf-ds.dmtC2S.R +++ b/tests/testthat/test-perf-ds.dmtC2S.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.dmtC2S::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.elspline.R b/tests/testthat/test-perf-ds.elspline.R index ba6a125c4..e331c8dc0 100644 --- a/tests/testthat/test-perf-ds.elspline.R +++ b/tests/testthat/test-perf-ds.elspline.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TRIG", "PM_BMI_CONTINUOUS")) # context("ds.elspline::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.exists.R b/tests/testthat/test-perf-ds.exists.R index 123d7e805..ef94b30d1 100644 --- a/tests/testthat/test-perf-ds.exists.R +++ b/tests/testthat/test-perf-ds.exists.R @@ -21,7 +21,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.exists::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.exp.R b/tests/testthat/test-perf-ds.exp.R index 8ab5b3d95..beaf5746c 100644 --- a/tests/testthat/test-perf-ds.exp.R +++ b/tests/testthat/test-perf-ds.exp.R @@ -20,7 +20,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.exp::perf:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.gamlss.R b/tests/testthat/test-perf-ds.gamlss.R index fe56280c4..723ca5866 100644 --- a/tests/testthat/test-perf-ds.gamlss.R +++ b/tests/testthat/test-perf-ds.gamlss.R @@ -13,7 +13,7 @@ connect.studies.dataset.gamlss(list("e3_bw", "e3_gac_None", "hs_zbmi_who", "hs_c # context("ds.gamlss::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.getWGSR.R b/tests/testthat/test-perf-ds.getWGSR.R index 70dea199e..df4133b37 100644 --- a/tests/testthat/test-perf-ds.getWGSR.R +++ b/tests/testthat/test-perf-ds.getWGSR.R @@ -12,7 +12,7 @@ connect.studies.dataset.anthro(list("age", "sex", "weight", "height", "muac")) # context("ds.getWGSR::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.glmPredict.R b/tests/testthat/test-perf-ds.glmPredict.R index ff2c2826c..98ecde68b 100644 --- a/tests/testthat/test-perf-ds.glmPredict.R +++ b/tests/testthat/test-perf-ds.glmPredict.R @@ -13,7 +13,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.glmPredict::perf::0") test_that("performance", { ds.glmSLMA('D$LAB_TSC~D$LAB_TRIG', family="gaussian", newobj="gaussian.glmslma.obj") - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.glmSummary.R b/tests/testthat/test-perf-ds.glmSummary.R index 80067e42d..2fa1905c6 100644 --- a/tests/testthat/test-perf-ds.glmSummary.R +++ b/tests/testthat/test-perf-ds.glmSummary.R @@ -13,7 +13,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG", "DIS_AMI", "DIS_DIAB", # context("ds.glmSummary::perf::0") test_that("performance", { ds.glmSLMA('D$LAB_TSC~D$LAB_TRIG', family="gaussian", newobj="gaussian.glmslma.obj") - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.heatmapPlot.R b/tests/testthat/test-perf-ds.heatmapPlot.R index a53cb988b..7f90bfb2f 100644 --- a/tests/testthat/test-perf-ds.heatmapPlot.R +++ b/tests/testthat/test-perf-ds.heatmapPlot.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.heatmapPlot::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.hetcor.R b/tests/testthat/test-perf-ds.hetcor.R index 23da1a959..c0dabff48 100644 --- a/tests/testthat/test-perf-ds.hetcor.R +++ b/tests/testthat/test-perf-ds.hetcor.R @@ -14,7 +14,7 @@ ds.dataFrame(c("D$LAB_TSC", "D$LAB_TRIG", "D$LAB_HDL", "D$LAB_GLUC_ADJUSTED", "D # context("ds.hetcor::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.histogram.R b/tests/testthat/test-perf-ds.histogram.R index c69f72524..743f4a180 100644 --- a/tests/testthat/test-perf-ds.histogram.R +++ b/tests/testthat/test-perf-ds.histogram.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.histogram::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.isNA.R b/tests/testthat/test-perf-ds.isNA.R index 9b60c5500..aa1acf5f8 100644 --- a/tests/testthat/test-perf-ds.isNA.R +++ b/tests/testthat/test-perf-ds.isNA.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2024-2025 Arjuna Technologies, Newcastle upon Tyne. All rights reserved. -# -# This program and the accompanying materials -# are made available under the terms of the GNU Public License v3.0. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -#------------------------------------------------------------------------------- - # # Set up # @@ -21,7 +11,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.isNA::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.isValid.R b/tests/testthat/test-perf-ds.isValid.R index 83cde48bb..d5b1da02c 100644 --- a/tests/testthat/test-perf-ds.isValid.R +++ b/tests/testthat/test-perf-ds.isValid.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.isValid::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.kurtosis.R b/tests/testthat/test-perf-ds.kurtosis.R index 310e6cb78..489376525 100644 --- a/tests/testthat/test-perf-ds.kurtosis.R +++ b/tests/testthat/test-perf-ds.kurtosis.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG", "LAB_HDL", "LAB_GLUC_A # context("ds.kurtosis::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.length.R b/tests/testthat/test-perf-ds.length.R index 6105cf99d..d28f84b56 100644 --- a/tests/testthat/test-perf-ds.length.R +++ b/tests/testthat/test-perf-ds.length.R @@ -21,7 +21,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.length::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.levels.R b/tests/testthat/test-perf-ds.levels.R index 4936a975c..d081c90f8 100644 --- a/tests/testthat/test-perf-ds.levels.R +++ b/tests/testthat/test-perf-ds.levels.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2024-2025 Arjuna Technologies, Newcastle upon Tyne. All rights reserved. -# -# This program and the accompanying materials -# are made available under the terms of the GNU Public License v3.0. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -#------------------------------------------------------------------------------- - # # Set up # @@ -21,7 +11,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "PM_BMI_CATEGORICAL")) # context("ds.levels::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.lexis.R b/tests/testthat/test-perf-ds.lexis.R index e6f3ebd26..d73e248a9 100644 --- a/tests/testthat/test-perf-ds.lexis.R +++ b/tests/testthat/test-perf-ds.lexis.R @@ -12,7 +12,7 @@ connect.studies.dataset.survival(list("id", "starttime", "endtime", "cens", "age # context("ds.lexis::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.list.R b/tests/testthat/test-perf-ds.list.R index 5b6fa4175..2421e2d63 100644 --- a/tests/testthat/test-perf-ds.list.R +++ b/tests/testthat/test-perf-ds.list.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_HDL")) # context("ds.list::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.log.R b/tests/testthat/test-perf-ds.log.R index 96ab0be27..c1ab9bdeb 100644 --- a/tests/testthat/test-perf-ds.log.R +++ b/tests/testthat/test-perf-ds.log.R @@ -20,7 +20,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.log::perf:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.ls.R b/tests/testthat/test-perf-ds.ls.R index e9ad009c6..783b0e04e 100644 --- a/tests/testthat/test-perf-ds.ls.R +++ b/tests/testthat/test-perf-ds.ls.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2024-2025 Arjuna Technologies, Newcastle upon Tyne. All rights reserved. -# -# This program and the accompanying materials -# are made available under the terms of the GNU Public License v3.0. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -#------------------------------------------------------------------------------- - # # Set up # @@ -21,7 +11,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.ls::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.lspline.R b/tests/testthat/test-perf-ds.lspline.R index 02dbe953f..2e6564441 100644 --- a/tests/testthat/test-perf-ds.lspline.R +++ b/tests/testthat/test-perf-ds.lspline.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TRIG", "PM_BMI_CONTINUOUS")) # context("ds.lspline::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.make.R b/tests/testthat/test-perf-ds.make.R index 1101ccd14..ed437c9f9 100644 --- a/tests/testthat/test-perf-ds.make.R +++ b/tests/testthat/test-perf-ds.make.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG", "LAB_HDL")) # context("ds.make::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.matrix.R b/tests/testthat/test-perf-ds.matrix.R index 8af68bfb1..c1dbfa58a 100644 --- a/tests/testthat/test-perf-ds.matrix.R +++ b/tests/testthat/test-perf-ds.matrix.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.matrix::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.matrixDet.R b/tests/testthat/test-perf-ds.matrixDet.R index 68b8285e2..8f6bd671d 100644 --- a/tests/testthat/test-perf-ds.matrixDet.R +++ b/tests/testthat/test-perf-ds.matrixDet.R @@ -13,7 +13,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.matrixDet::perf::0") test_that("performance", { ds.matrix(mdata=0, nrows.scalar=3, ncols.scalar=3, newobj="matrix.newobj") - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.matrixDet.report.R b/tests/testthat/test-perf-ds.matrixDet.report.R index 76d2a458c..d7a8db68c 100644 --- a/tests/testthat/test-perf-ds.matrixDet.report.R +++ b/tests/testthat/test-perf-ds.matrixDet.report.R @@ -13,7 +13,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.matrixDet.report::perf::0") test_that("performance", { ds.matrix(mdata=0, nrows.scalar=3, ncols.scalar=3, newobj="matrix.newobj") - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.matrixDiag.R b/tests/testthat/test-perf-ds.matrixDiag.R index f95fd8152..cc3061de7 100644 --- a/tests/testthat/test-perf-ds.matrixDiag.R +++ b/tests/testthat/test-perf-ds.matrixDiag.R @@ -13,7 +13,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.matrixDiag::perf::0") test_that("performance", { ds.matrix(mdata=0, nrows.scalar=3, ncols.scalar=3, newobj="matrix.newobj") - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.matrixDimnames.R b/tests/testthat/test-perf-ds.matrixDimnames.R index d0ae33f69..ddda41331 100644 --- a/tests/testthat/test-perf-ds.matrixDimnames.R +++ b/tests/testthat/test-perf-ds.matrixDimnames.R @@ -13,7 +13,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.matrixDimnames::perf::0") test_that("performance", { ds.matrix(mdata=0, nrows.scalar=3, ncols.scalar=3, newobj="matrix.newobj") - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.matrixInvert.R b/tests/testthat/test-perf-ds.matrixInvert.R index 1f8492f8b..a640e6b2d 100644 --- a/tests/testthat/test-perf-ds.matrixInvert.R +++ b/tests/testthat/test-perf-ds.matrixInvert.R @@ -13,7 +13,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.matrixInvert::perf::0") test_that("performance", { ds.matrix(mdata=c(1,0,0,0,1,0,0,0,1), nrows.scalar=3, ncols.scalar=3, newobj="matrix.newobj") - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.matrixMult.R b/tests/testthat/test-perf-ds.matrixMult.R index 7abfdf00d..cab22ae8f 100644 --- a/tests/testthat/test-perf-ds.matrixMult.R +++ b/tests/testthat/test-perf-ds.matrixMult.R @@ -13,7 +13,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.matrixMult::perf::0") test_that("performance", { ds.matrix(mdata=0, nrows.scalar=3, ncols.scalar=3, newobj="matrix.newobj") - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.matrixTranspose.R b/tests/testthat/test-perf-ds.matrixTranspose.R index 2c1d58cef..bf87cf254 100644 --- a/tests/testthat/test-perf-ds.matrixTranspose.R +++ b/tests/testthat/test-perf-ds.matrixTranspose.R @@ -13,7 +13,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.matrixTranspose::perf::0") test_that("performance", { ds.matrix(mdata=0, nrows.scalar=3, ncols.scalar=3, newobj="matrix.newobj") - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.mean.R b/tests/testthat/test-perf-ds.mean.R index 03d0ac78a..19aa185d8 100644 --- a/tests/testthat/test-perf-ds.mean.R +++ b/tests/testthat/test-perf-ds.mean.R @@ -21,7 +21,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.mean::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time @@ -52,7 +52,7 @@ test_that("combine - performance", { # context("ds.mean::perf::split:0") test_that("split - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.meanSdGp.R b/tests/testthat/test-perf-ds.meanSdGp.R index b06c2d6cb..6a50df597 100644 --- a/tests/testthat/test-perf-ds.meanSdGp.R +++ b/tests/testthat/test-perf-ds.meanSdGp.R @@ -12,7 +12,7 @@ connect.studies.dataset.survival(list("age.60", "female")) # context("ds.meanSdGp::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.merge.R b/tests/testthat/test-perf-ds.merge.R index c0f774378..ee0c9fdaf 100644 --- a/tests/testthat/test-perf-ds.merge.R +++ b/tests/testthat/test-perf-ds.merge.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG", "LAB_HDL", "DIS_CVA", # context("ds.merge::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.metadata.R b/tests/testthat/test-perf-ds.metadata.R index 56b1e130a..bbba0769b 100644 --- a/tests/testthat/test-perf-ds.metadata.R +++ b/tests/testthat/test-perf-ds.metadata.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list('LAB_TSC', 'LAB_TRIG', 'LAB_HDL', 'LAB_GLUC_A # context("ds.metadata::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.mice.R b/tests/testthat/test-perf-ds.mice.R index e928c0d74..1eb47661e 100644 --- a/tests/testthat/test-perf-ds.mice.R +++ b/tests/testthat/test-perf-ds.mice.R @@ -14,7 +14,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC","LAB_TRIG","LAB_HDL","LAB_GLUC_ADJU # context("ds.mice::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.names.R b/tests/testthat/test-perf-ds.names.R index bd39e6afc..6faaa5002 100644 --- a/tests/testthat/test-perf-ds.names.R +++ b/tests/testthat/test-perf-ds.names.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2024-2025 Arjuna Technologies, Newcastle upon Tyne. All rights reserved. -# -# This program and the accompanying materials -# are made available under the terms of the GNU Public License v3.0. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -#------------------------------------------------------------------------------- - # # Set up # @@ -21,7 +11,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.names::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.ns.R b/tests/testthat/test-perf-ds.ns.R index 074da997d..5db67cd21 100644 --- a/tests/testthat/test-perf-ds.ns.R +++ b/tests/testthat/test-perf-ds.ns.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TRIG", "PM_BMI_CONTINUOUS")) # context("ds.ns::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.numNA.R b/tests/testthat/test-perf-ds.numNA.R index 682f5c71d..b72dc4b9b 100644 --- a/tests/testthat/test-perf-ds.numNA.R +++ b/tests/testthat/test-perf-ds.numNA.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2024-2025 Arjuna Technologies, Newcastle upon Tyne. All rights reserved. -# -# This program and the accompanying materials -# are made available under the terms of the GNU Public License v3.0. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -#------------------------------------------------------------------------------- - # # Set up # @@ -21,7 +11,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.numNA::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.qlspline.R b/tests/testthat/test-perf-ds.qlspline.R index 9e624339a..4c6633ec1 100644 --- a/tests/testthat/test-perf-ds.qlspline.R +++ b/tests/testthat/test-perf-ds.qlspline.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TRIG", "PM_BMI_CONTINUOUS")) # context("ds.qlspline::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.quantileMean.R b/tests/testthat/test-perf-ds.quantileMean.R index edef680fd..d4e264110 100644 --- a/tests/testthat/test-perf-ds.quantileMean.R +++ b/tests/testthat/test-perf-ds.quantileMean.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list('LAB_HDL')) # context("ds.quantileMean::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.rBinom.R b/tests/testthat/test-perf-ds.rBinom.R index 1fe34f153..8a13573b1 100644 --- a/tests/testthat/test-perf-ds.rBinom.R +++ b/tests/testthat/test-perf-ds.rBinom.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.rBinom::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.rNorm.R b/tests/testthat/test-perf-ds.rNorm.R index 5a618d60a..a2318e689 100644 --- a/tests/testthat/test-perf-ds.rNorm.R +++ b/tests/testthat/test-perf-ds.rNorm.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.rNorm::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.rPois.R b/tests/testthat/test-perf-ds.rPois.R index 381892dd1..cdd10eb3a 100644 --- a/tests/testthat/test-perf-ds.rPois.R +++ b/tests/testthat/test-perf-ds.rPois.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.rPois::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.rUnif.R b/tests/testthat/test-perf-ds.rUnif.R index ef0da14f7..65f03e35b 100644 --- a/tests/testthat/test-perf-ds.rUnif.R +++ b/tests/testthat/test-perf-ds.rUnif.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.rUnif::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.rbind.R b/tests/testthat/test-perf-ds.rbind.R index 9ad0f843d..fe95bf975 100644 --- a/tests/testthat/test-perf-ds.rbind.R +++ b/tests/testthat/test-perf-ds.rbind.R @@ -12,7 +12,7 @@ connect.studies.dataset.survival(list("survtime", "time.id", "female", "age.60") # context("ds.rbind::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.reShape.R b/tests/testthat/test-perf-ds.reShape.R index a6aa856a0..3b0d20e3c 100644 --- a/tests/testthat/test-perf-ds.reShape.R +++ b/tests/testthat/test-perf-ds.reShape.R @@ -12,7 +12,7 @@ connect.studies.dataset.survival(list("id", "study.id", "time.id", "cens", "age. # context("ds.reShape::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.recodeValues.R b/tests/testthat/test-perf-ds.recodeValues.R index a423d2f16..ed3f0abf7 100644 --- a/tests/testthat/test-perf-ds.recodeValues.R +++ b/tests/testthat/test-perf-ds.recodeValues.R @@ -12,7 +12,7 @@ connect.studies.dataset.survival(list("survtime", "time.id", "female", "age.60") # context("ds.recodeValues::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.rep.R b/tests/testthat/test-perf-ds.rep.R index bb1108ff4..f24cb1989 100644 --- a/tests/testthat/test-perf-ds.rep.R +++ b/tests/testthat/test-perf-ds.rep.R @@ -12,7 +12,7 @@ connect.studies.dataset.survival(list("survtime", "time.id", "female")) # context("ds.rep::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.replaceNA.R b/tests/testthat/test-perf-ds.replaceNA.R index 9d9aeb4ff..40818c9f0 100644 --- a/tests/testthat/test-perf-ds.replaceNA.R +++ b/tests/testthat/test-perf-ds.replaceNA.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_HDL", "LAB_TRIG", "DIS_CVA")) # context("ds.replaceNA::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.rowColCalc.R b/tests/testthat/test-perf-ds.rowColCalc.R index 54b1755ed..44cd13c16 100644 --- a/tests/testthat/test-perf-ds.rowColCalc.R +++ b/tests/testthat/test-perf-ds.rowColCalc.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_HDL")) # context("ds.rowColCalc::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.sample.R b/tests/testthat/test-perf-ds.sample.R index 3ea06d173..f353aeec1 100644 --- a/tests/testthat/test-perf-ds.sample.R +++ b/tests/testthat/test-perf-ds.sample.R @@ -12,7 +12,7 @@ connect.studies.dataset.survival(list("survtime", "time.id", "female")) # context("ds.sample::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.scatterPlot.R b/tests/testthat/test-perf-ds.scatterPlot.R index 714b86e8d..8ee3b2187 100644 --- a/tests/testthat/test-perf-ds.scatterPlot.R +++ b/tests/testthat/test-perf-ds.scatterPlot.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.scatterPlot::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.seq.R b/tests/testthat/test-perf-ds.seq.R index d12858578..5c8046fb9 100644 --- a/tests/testthat/test-perf-ds.seq.R +++ b/tests/testthat/test-perf-ds.seq.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.seq::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.setSeed.R b/tests/testthat/test-perf-ds.setSeed.R index 87b6537ef..a23e292f6 100644 --- a/tests/testthat/test-perf-ds.setSeed.R +++ b/tests/testthat/test-perf-ds.setSeed.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.setSeed::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.skewness.R b/tests/testthat/test-perf-ds.skewness.R index 553ccd179..7ad9d6fde 100644 --- a/tests/testthat/test-perf-ds.skewness.R +++ b/tests/testthat/test-perf-ds.skewness.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG", "LAB_HDL", "LAB_GLUC_A # context("ds.skewness::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.sqrt.R b/tests/testthat/test-perf-ds.sqrt.R index dffdbbb64..2acbd8ee0 100644 --- a/tests/testthat/test-perf-ds.sqrt.R +++ b/tests/testthat/test-perf-ds.sqrt.R @@ -20,7 +20,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.sqrt::perf:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.summary.R b/tests/testthat/test-perf-ds.summary.R index 65b65841e..9b3e7d9fe 100644 --- a/tests/testthat/test-perf-ds.summary.R +++ b/tests/testthat/test-perf-ds.summary.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list('LAB_TSC', 'LAB_TRIG', 'LAB_HDL', 'LAB_GLUC_A # context("ds.summary::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.table.R b/tests/testthat/test-perf-ds.table.R index 0888fa082..73eaae718 100644 --- a/tests/testthat/test-perf-ds.table.R +++ b/tests/testthat/test-perf-ds.table.R @@ -19,7 +19,7 @@ ds.dataFrameSubset(df.name="tablesource", V1.name="factorInteger", V2.name='6', # context("ds.table::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.tapply.R b/tests/testthat/test-perf-ds.tapply.R index a1bc1b656..c9215c9ec 100644 --- a/tests/testthat/test-perf-ds.tapply.R +++ b/tests/testthat/test-perf-ds.tapply.R @@ -15,7 +15,7 @@ ds.assign('D$GENDER', 'GENDER') # context("ds.tapply::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.tapply.assign.R b/tests/testthat/test-perf-ds.tapply.assign.R index 453ef1b42..6f5287750 100644 --- a/tests/testthat/test-perf-ds.tapply.assign.R +++ b/tests/testthat/test-perf-ds.tapply.assign.R @@ -15,7 +15,7 @@ ds.assign('D$GENDER', 'GENDER') # context("ds.tapply.assign::perf::0") test_that("performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.unList.R b/tests/testthat/test-perf-ds.unList.R index f2336847c..3a2ab912f 100644 --- a/tests/testthat/test-perf-ds.unList.R +++ b/tests/testthat/test-perf-ds.unList.R @@ -13,7 +13,7 @@ connect.studies.dataset.cnsim(list("GENDER")) # context("ds.unList::perf::0") test_that("performance", { ds.asList("D$GENDER", newobj="list.newobj") - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.unique.R b/tests/testthat/test-perf-ds.unique.R index cc4f54d20..3bb541f82 100644 --- a/tests/testthat/test-perf-ds.unique.R +++ b/tests/testthat/test-perf-ds.unique.R @@ -1,13 +1,3 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2024-2025 Arjuna Technologies, Newcastle upon Tyne. All rights reserved. -# -# This program and the accompanying materials -# are made available under the terms of the GNU Public License v3.0. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -#------------------------------------------------------------------------------- - # # Set up # @@ -21,7 +11,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC", "LAB_TRIG")) # context("ds.unique::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-perf-ds.var.R b/tests/testthat/test-perf-ds.var.R index ffea72eb4..71fe1e87f 100644 --- a/tests/testthat/test-perf-ds.var.R +++ b/tests/testthat/test-perf-ds.var.R @@ -12,7 +12,7 @@ connect.studies.dataset.cnsim(list("LAB_TSC")) # context("ds.var::perf::combine:0") test_that("combine - performance", { - .durationSec <- 30 # seconds + .durationSec <- perf.testduration() .count <- 0 .start.time <- Sys.time() .current.time <- .start.time diff --git a/tests/testthat/test-smk-ds.Boole.R b/tests/testthat/test-smk-ds.Boole.R index c5bbd76cd..235589a40 100644 --- a/tests/testthat/test-smk-ds.Boole.R +++ b/tests/testthat/test-smk-ds.Boole.R @@ -161,6 +161,19 @@ test_that("simple boole, big neg constant V2", { expect_equal(res.boole$sim3$`quantiles & mean`[[8]], 0.0) }) +test_that("fails if the object does not exist", { + expect_error( + ds.Boole(V1 = "nonexistent_object", V2 = "1", Boolean.operator = "=="), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.abs.R b/tests/testthat/test-smk-ds.abs.R index fb3783fbd..e77c3c520 100644 --- a/tests/testthat/test-smk-ds.abs.R +++ b/tests/testthat/test-smk-ds.abs.R @@ -45,6 +45,32 @@ test_that("simple c", { expect_equal(res.class$sim3, "numeric") }) +test_that("fails if the object does not exist", { + expect_error( + ds.abs(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.abs(x = "D"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type numeric or integer. 'D' is type data.frame.", fixed = TRUE) + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.asCharacter.R b/tests/testthat/test-smk-ds.asCharacter.R index abc702e70..fd88f4e8f 100644 --- a/tests/testthat/test-smk-ds.asCharacter.R +++ b/tests/testthat/test-smk-ds.asCharacter.R @@ -35,6 +35,19 @@ test_that("simple test", { expect_equal(res.class$sim3, "character") }) +test_that("fails if the object does not exist", { + expect_error( + ds.asCharacter(x.name = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.asDataMatrix.R b/tests/testthat/test-smk-ds.asDataMatrix.R index a9ca652a1..6dd8f6633 100644 --- a/tests/testthat/test-smk-ds.asDataMatrix.R +++ b/tests/testthat/test-smk-ds.asDataMatrix.R @@ -42,6 +42,19 @@ test_that("simple test", { expect_true("matrix" %in% res.class$sim3) }) +test_that("fails if the object does not exist", { + expect_error( + ds.asDataMatrix(x.name = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.asFactor.R b/tests/testthat/test-smk-ds.asFactor.R index c87d06a75..80947a453 100644 --- a/tests/testthat/test-smk-ds.asFactor.R +++ b/tests/testthat/test-smk-ds.asFactor.R @@ -109,6 +109,19 @@ test_that("with fixed.dummy.vars of TRUE and baseline.level of 6", { expect_true("matrix" %in% res$`survival3`) }) +test_that("fails if the object does not exist", { + expect_error( + ds.asFactor(input.var.name = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.asFactorSimple.R b/tests/testthat/test-smk-ds.asFactorSimple.R index 029b3465e..1fb147293 100644 --- a/tests/testthat/test-smk-ds.asFactorSimple.R +++ b/tests/testthat/test-smk-ds.asFactorSimple.R @@ -40,6 +40,19 @@ test_that("with no force.factor.levels", { expect_equal("All tables are valid!", res2$validity) }) +test_that("fails if the object does not exist", { + expect_error( + ds.asFactorSimple(input.var.name = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.asInteger.R b/tests/testthat/test-smk-ds.asInteger.R index b59ae832e..3a0357dd2 100644 --- a/tests/testthat/test-smk-ds.asInteger.R +++ b/tests/testthat/test-smk-ds.asInteger.R @@ -35,6 +35,19 @@ test_that("simple test", { expect_equal(res.class$sim3, "integer") }) +test_that("fails if the object does not exist", { + expect_error( + ds.asInteger(x.name = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.asLogical.R b/tests/testthat/test-smk-ds.asLogical.R index 64ad15ece..e45a5ab22 100644 --- a/tests/testthat/test-smk-ds.asLogical.R +++ b/tests/testthat/test-smk-ds.asLogical.R @@ -35,6 +35,32 @@ test_that("simple test", { expect_equal(res.class$sim3, "logical") }) +test_that("fails if the object does not exist", { + expect_error( + ds.asLogical(x.name = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.asLogical(x.name = "D"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type numeric, integer, character or matrix. 'D' is type data.frame.", fixed = TRUE) + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.asMatrix.R b/tests/testthat/test-smk-ds.asMatrix.R index b05b3e846..971ab3ca6 100644 --- a/tests/testthat/test-smk-ds.asMatrix.R +++ b/tests/testthat/test-smk-ds.asMatrix.R @@ -35,6 +35,19 @@ test_that("simple test", { expect_true("matrix" %in% res.class$sim3) }) +test_that("fails if the object does not exist", { + expect_error( + ds.asMatrix(x.name = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.asNumeric.R b/tests/testthat/test-smk-ds.asNumeric.R index beb3d0f80..d5d512569 100644 --- a/tests/testthat/test-smk-ds.asNumeric.R +++ b/tests/testthat/test-smk-ds.asNumeric.R @@ -35,6 +35,19 @@ test_that("simple test", { expect_equal(res.class$sim3, "numeric") }) +test_that("fails if the object does not exist", { + expect_error( + ds.asNumeric(x.name = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.boxPlotGG.R b/tests/testthat/test-smk-ds.boxPlotGG.R index 68d9c4048..295bf3436 100644 --- a/tests/testthat/test-smk-ds.boxPlotGG.R +++ b/tests/testthat/test-smk-ds.boxPlotGG.R @@ -23,6 +23,19 @@ test_that("simple boxPlotGG", { expect_true(inherits(res, "ggplot")) }) +test_that("fails if the object does not exist", { + expect_error( + ds.boxPlotGG(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.c.R b/tests/testthat/test-smk-ds.c.R index 8c90db2e2..fa109c540 100644 --- a/tests/testthat/test-smk-ds.c.R +++ b/tests/testthat/test-smk-ds.c.R @@ -32,6 +32,19 @@ test_that("simple c", { expect_length(res, 0) }) +test_that("fails if the object does not exist", { + expect_error( + ds.c(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.cbind.R b/tests/testthat/test-smk-ds.cbind.R index b3aac867e..88cd6de5a 100644 --- a/tests/testthat/test-smk-ds.cbind.R +++ b/tests/testthat/test-smk-ds.cbind.R @@ -229,6 +229,19 @@ test_that("simple test, from root variables, DataSHIELD.check=TRUE", { ds.rm("cbind4_newobj") }) +test_that("fails if the object does not exist", { + expect_error( + ds.cbind(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.changeRefGroup.R b/tests/testthat/test-smk-ds.changeRefGroup.R index 5c0964dfd..d75b5139f 100644 --- a/tests/testthat/test-smk-ds.changeRefGroup.R +++ b/tests/testthat/test-smk-ds.changeRefGroup.R @@ -61,6 +61,32 @@ test_that("simple changeRefGroup", { expect_equal(res.levels$sim3$Levels[3], 'overweight') }) +test_that("fails if the object does not exist", { + expect_error( + ds.changeRefGroup(x = "nonexistent_object", ref = "1"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.changeRefGroup(x = "D", ref = "1"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type factor. 'D' is type data.frame.", fixed = TRUE) + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.class.R b/tests/testthat/test-smk-ds.class.R index 2d4def08a..0926043a4 100644 --- a/tests/testthat/test-smk-ds.class.R +++ b/tests/testthat/test-smk-ds.class.R @@ -48,6 +48,19 @@ test_that("simple class", { expect_equal(res2$sim3, "factor") }) +test_that("fails if the object does not exist", { + expect_error( + ds.class(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.completeCases.R b/tests/testthat/test-smk-ds.completeCases.R index 3e6058829..b40461ee7 100644 --- a/tests/testthat/test-smk-ds.completeCases.R +++ b/tests/testthat/test-smk-ds.completeCases.R @@ -147,6 +147,19 @@ test_that("completeCases, wrong input class returns a server error", { ds.rm("not_a_df") }) +test_that("fails if the object does not exist", { + expect_error( + ds.completeCases(x1 = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.cor.R b/tests/testthat/test-smk-ds.cor.R index 47a8b5011..44e97be2d 100644 --- a/tests/testthat/test-smk-ds.cor.R +++ b/tests/testthat/test-smk-ds.cor.R @@ -91,6 +91,35 @@ test_that("simple test, split, casewise.complete", { expect_true("matrix" %in% class(res[[3]]$`Number of complete cases used`)) }) +test_that("fails if the object does not exist", { + expect_error( + ds.cor(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + ds.asCharacter(x = "D$survtime", newobj = "not_a_numeric") + expect_error( + ds.cor(x = "not_a_numeric", y = "D$survtime"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type numeric, integer, matrix or data.frame. 'not_a_numeric' is type character.", fixed = TRUE) + } + + ds.rm("not_a_numeric") +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.corTest.R b/tests/testthat/test-smk-ds.corTest.R index 3efa02bfd..54716ecf1 100644 --- a/tests/testthat/test-smk-ds.corTest.R +++ b/tests/testthat/test-smk-ds.corTest.R @@ -121,6 +121,32 @@ test_that("simple test", { expect_equal(res$survival3$`Correlation test`[[8]], "x.var and y.var") }) +test_that("fails if the object does not exist", { + expect_error( + ds.corTest(x = "nonexistent_object", y = "D$survtime"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.corTest(x = "D", y = "D$survtime"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type numeric or integer. 'D' is type data.frame.", fixed = TRUE) + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.cov.R b/tests/testthat/test-smk-ds.cov.R index e468051bf..8c2c0689e 100644 --- a/tests/testthat/test-smk-ds.cov.R +++ b/tests/testthat/test-smk-ds.cov.R @@ -64,6 +64,35 @@ test_that("simple test, combine", { expect_equal(res$`Error message`[[3]], NA) }) +test_that("fails if the object does not exist", { + expect_error( + ds.cov(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + ds.asCharacter(x = "D$survtime", newobj = "not_a_numeric") + expect_error( + ds.cov(x = "not_a_numeric", y = "D$survtime"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type numeric, integer, matrix or data.frame. 'not_a_numeric' is type character.", fixed = TRUE) + } + + ds.rm("not_a_numeric") +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.dataFrame.R b/tests/testthat/test-smk-ds.dataFrame.R index 8bfb2d7ce..0618aa36f 100644 --- a/tests/testthat/test-smk-ds.dataFrame.R +++ b/tests/testthat/test-smk-ds.dataFrame.R @@ -167,6 +167,19 @@ test_that("dataframe_exists, with DataSHIELD.checks, from dataframe variables", ds.rm("dataframe1") }) +test_that("fails if the object does not exist", { + expect_error( + ds.dataFrame(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.dataFrameFill.R b/tests/testthat/test-smk-ds.dataFrameFill.R index c05064fac..33e373996 100644 --- a/tests/testthat/test-smk-ds.dataFrameFill.R +++ b/tests/testthat/test-smk-ds.dataFrameFill.R @@ -100,6 +100,19 @@ test_that("dataFrameFill_exists", { expect_equal(classFilled$discordant3, "integer") }) +test_that("fails if the object does not exist", { + expect_error( + ds.dataFrameFill(df.name = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.dataFrameSort.R b/tests/testthat/test-smk-ds.dataFrameSort.R index 73ca599b2..4b8398a58 100644 --- a/tests/testthat/test-smk-ds.dataFrameSort.R +++ b/tests/testthat/test-smk-ds.dataFrameSort.R @@ -35,6 +35,19 @@ test_that("dataFrameSort_exists", { ds_expect_variables(c("D", "unsorted_df", "sorted_df")) }) +test_that("fails if the object does not exist", { + expect_error( + ds.dataFrameSort(df.name = "nonexistent_object", sort.key.name = "D$LAB_TSC"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Shutdown # diff --git a/tests/testthat/test-smk-ds.dataFrameSubset.R b/tests/testthat/test-smk-ds.dataFrameSubset.R index b5f601458..64cfdbd9d 100644 --- a/tests/testthat/test-smk-ds.dataFrameSubset.R +++ b/tests/testthat/test-smk-ds.dataFrameSubset.R @@ -91,6 +91,19 @@ test_that("dataFrameSubset_exists scalar", { }) +test_that("fails if the object does not exist", { + expect_error( + ds.dataFrameSubset(df.name = "nonexistent_object", V1.name = "D$LAB_TSC", V2.name = "1", Boolean.operator = ">"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.dim.R b/tests/testthat/test-smk-ds.dim.R index 8ba7266a0..78a11cbd1 100644 --- a/tests/testthat/test-smk-ds.dim.R +++ b/tests/testthat/test-smk-ds.dim.R @@ -78,6 +78,19 @@ test_that("dim of a vector is NULL, as in R", { } }) +test_that("fails if the object does not exist", { + expect_error( + ds.dim(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.exp.R b/tests/testthat/test-smk-ds.exp.R index d4ef60989..c3de97e70 100644 --- a/tests/testthat/test-smk-ds.exp.R +++ b/tests/testthat/test-smk-ds.exp.R @@ -54,6 +54,32 @@ test_that("simple exp", { expect_equal(res2_class$sim3, "numeric") }) +test_that("fails if the object does not exist", { + expect_error( + ds.exp(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.exp(x = "D"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type numeric or integer. 'D' is type data.frame.", fixed = TRUE) + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.gamlss.R b/tests/testthat/test-smk-ds.gamlss.R index 1e4ad232c..ff888bd1e 100644 --- a/tests/testthat/test-smk-ds.gamlss.R +++ b/tests/testthat/test-smk-ds.gamlss.R @@ -378,6 +378,35 @@ test_that("gamlss, WEIGHT GAIN", { expect_equal(as.numeric(model_wgtgain.DS$study1$centiles[9,'per']), 98.682043, tolerance=1e-7) }) +test_that("fails if the object does not exist", { + expect_error( + ds.gamlss(formula = "e3_bw~e3_gac_None", data = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + ds.asCharacter(x = "D$e3_bw", newobj = "not_a_df") + expect_error( + ds.gamlss(formula = "e3_bw~e3_gac_None", data = "not_a_df"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type data.frame or list. 'not_a_df' is type character.", fixed = TRUE) + } + + ds.rm("not_a_df") +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.glm-gaussian.R b/tests/testthat/test-smk-ds.glm-gaussian.R index 2ac603aa5..f5211e553 100644 --- a/tests/testthat/test-smk-ds.glm-gaussian.R +++ b/tests/testthat/test-smk-ds.glm-gaussian.R @@ -77,6 +77,32 @@ test_that("glm_gaussian, with check", { expect_equal(res$output.information, "SEE TOP OF OUTPUT FOR INFORMATION ON MISSING DATA AND ERROR MESSAGES") }) +test_that("fails if the object does not exist", { + expect_error( + ds.glm(formula = "LAB_TSC~LAB_TRIG", data = "nonexistent_object", family = "gaussian"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.glm(formula = "LAB_TSC~LAB_TRIG", data = "D$LAB_TSC", family = "gaussian"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type data.frame or list. 'D$LAB_TSC' is type numeric.", fixed = TRUE) + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.glmSLMA.R b/tests/testthat/test-smk-ds.glmSLMA.R index b9e6e706e..02928863b 100644 --- a/tests/testthat/test-smk-ds.glmSLMA.R +++ b/tests/testthat/test-smk-ds.glmSLMA.R @@ -343,6 +343,32 @@ test_that("simple glmSLMA, poisson-assigned", { "str.medi.lpd", "num.medi.lpd", "str.gender", "num.gender", "str.dis.diab", "num.dis.diab")) }) +test_that("fails if the object does not exist", { + expect_error( + ds.glmSLMA(formula = "LAB_TSC~LAB_TRIG", family = "gaussian", dataName = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.glmSLMA(formula = "LAB_TSC~LAB_TRIG", family = "gaussian", dataName = "D$LAB_TSC"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type data.frame or list. 'D$LAB_TSC' is type numeric.", fixed = TRUE) + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.glmSummary.R b/tests/testthat/test-smk-ds.glmSummary.R index 067f87b9b..46c004492 100644 --- a/tests/testthat/test-smk-ds.glmSummary.R +++ b/tests/testthat/test-smk-ds.glmSummary.R @@ -151,6 +151,19 @@ test_that("simple glmSummary, poisson", { ds_expect_variables(c("D", "gaussian.glmslma.obj", "gaussian.glmsummary.obj", "poisson.glmslma.obj", "poisson.glmsummary.obj", "summary_glm.newobj")) }) +test_that("fails if the object does not exist", { + expect_error( + ds.glmSummary(x.name = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Shutdown # diff --git a/tests/testthat/test-smk-ds.glmerSLMA.R b/tests/testthat/test-smk-ds.glmerSLMA.R index 4ad25a02f..d5e48c279 100644 --- a/tests/testthat/test-smk-ds.glmerSLMA.R +++ b/tests/testthat/test-smk-ds.glmerSLMA.R @@ -246,6 +246,35 @@ test_that("check slope formulae - 2", { expect_equal(class(res$Convergence.error.message), "character") }) +test_that("fails if the object does not exist", { + expect_error( + ds.glmerSLMA(formula = "incid_rate ~ trtGrp + Male + (1|idDoctor)", dataName = "nonexistent_object", family = "poisson"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + ds.asCharacter(x = "D$incid_rate", newobj = "not_a_df") + expect_error( + ds.glmerSLMA(formula = "incid_rate ~ trtGrp + Male + (1|idDoctor)", dataName = "not_a_df", family = "poisson"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type data.frame or list. 'not_a_df' is type character.", fixed = TRUE) + } + + ds.rm("not_a_df") +}) + # # Shutdown phase 2 # diff --git a/tests/testthat/test-smk-ds.isNA.R b/tests/testthat/test-smk-ds.isNA.R index 8e916251e..746952e56 100644 --- a/tests/testthat/test-smk-ds.isNA.R +++ b/tests/testthat/test-smk-ds.isNA.R @@ -49,6 +49,19 @@ test_that("isNA, wrong input class returns a server error", { # context("ds.isNA::smk::shutdown") +test_that("fails if the object does not exist", { + expect_error( + ds.isNA(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + test_that("shutdown", { ds_expect_variables(c("D")) }) diff --git a/tests/testthat/test-smk-ds.kurtosis.R b/tests/testthat/test-smk-ds.kurtosis.R index 97695f91d..5b7fb3517 100644 --- a/tests/testthat/test-smk-ds.kurtosis.R +++ b/tests/testthat/test-smk-ds.kurtosis.R @@ -790,6 +790,32 @@ test_that("simple kurtosis, method 3, both, on PM_BMI_CONTINUOUS", { expect_equal(kurtosis.res$Global.Kurtosis$Nvalid[1], 8927) }) +test_that("fails if the object does not exist", { + expect_error( + ds.kurtosis(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.kurtosis(x = "D"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type numeric or integer. 'D' is type data.frame.", fixed = TRUE) + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.length.R b/tests/testthat/test-smk-ds.length.R index 5df9be590..e76e982b4 100644 --- a/tests/testthat/test-smk-ds.length.R +++ b/tests/testthat/test-smk-ds.length.R @@ -78,6 +78,19 @@ test_that("basic length, combine", { expect_equal(res.length$`total length of D$LAB_TSC in all studies combined`, 9379) }) +test_that("fails if the object does not exist", { + expect_error( + ds.length(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.levels.R b/tests/testthat/test-smk-ds.levels.R index ab94f2ba1..c98c0fbc1 100644 --- a/tests/testthat/test-smk-ds.levels.R +++ b/tests/testthat/test-smk-ds.levels.R @@ -76,6 +76,19 @@ test_that("levels, wrong input class returns a server error", { expect_match(res.errors[[1]], "must be of type factor") }) +test_that("fails if the object does not exist", { + expect_error( + ds.levels(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.list.R b/tests/testthat/test-smk-ds.list.R index 85ff10d86..9069b2816 100644 --- a/tests/testthat/test-smk-ds.list.R +++ b/tests/testthat/test-smk-ds.list.R @@ -75,6 +75,19 @@ test_that("Is List", { # context("ds.list::smk::shutdown") +test_that("fails if the object does not exist", { + expect_error( + ds.list(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + test_that("shutdown", { ds_expect_variables(c("D", "my_newobj")) }) diff --git a/tests/testthat/test-smk-ds.lmerSLMA.R b/tests/testthat/test-smk-ds.lmerSLMA.R index 7d352a9c2..620abc63c 100644 --- a/tests/testthat/test-smk-ds.lmerSLMA.R +++ b/tests/testthat/test-smk-ds.lmerSLMA.R @@ -248,6 +248,35 @@ test_that("check slope formulae", { expect_equal(class(res$Convergence.error.message), "character") }) +test_that("fails if the object does not exist", { + expect_error( + ds.lmerSLMA(formula = "incid_rate ~ trtGrp + Male + (1|idDoctor)", dataName = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + ds.asCharacter(x = "D$incid_rate", newobj = "not_a_df") + expect_error( + ds.lmerSLMA(formula = "incid_rate ~ trtGrp + Male + (1|idDoctor)", dataName = "not_a_df"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type data.frame or list. 'not_a_df' is type character.", fixed = TRUE) + } + + ds.rm("not_a_df") +}) + # # Shutdown # diff --git a/tests/testthat/test-smk-ds.log.R b/tests/testthat/test-smk-ds.log.R index 558781754..777387f18 100644 --- a/tests/testthat/test-smk-ds.log.R +++ b/tests/testthat/test-smk-ds.log.R @@ -54,6 +54,32 @@ test_that("simple log", { expect_equal(res2_class$sim3, "numeric") }) +test_that("fails if the object does not exist", { + expect_error( + ds.log(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.log(x = "D"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type numeric or integer. 'D' is type data.frame.", fixed = TRUE) + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.matrixDet.R b/tests/testthat/test-smk-ds.matrixDet.R index cc9a6ae93..bd3b549e9 100644 --- a/tests/testthat/test-smk-ds.matrixDet.R +++ b/tests/testthat/test-smk-ds.matrixDet.R @@ -48,6 +48,32 @@ test_that("simplest ds.matrixDet", { # context("ds.matrixDet::smk::shutdown") +test_that("fails if the object does not exist", { + expect_error( + ds.matrixDet(M1 = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.matrixDet(M1 = "D$LAB_TSC"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type matrix or data.frame. 'D$LAB_TSC' is type numeric.", fixed = TRUE) + } +}) + test_that("shutdown", { ds_expect_variables(c("D", "matrix.newobj", "matrixdet.newobj")) }) diff --git a/tests/testthat/test-smk-ds.matrixDet.report.R b/tests/testthat/test-smk-ds.matrixDet.report.R index 20850a5a3..4751e5f11 100644 --- a/tests/testthat/test-smk-ds.matrixDet.report.R +++ b/tests/testthat/test-smk-ds.matrixDet.report.R @@ -54,6 +54,32 @@ test_that("simplest ds.matrixDet.report", { # context("ds.matrixDet.report::smk::shutdown") +test_that("fails if the object does not exist", { + expect_error( + ds.matrixDet.report(M1 = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.matrixDet.report(M1 = "D$LAB_TSC"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type matrix or data.frame. 'D$LAB_TSC' is type numeric.", fixed = TRUE) + } +}) + test_that("shutdown", { ds_expect_variables(c("D", "matrix.newobj")) }) diff --git a/tests/testthat/test-smk-ds.matrixDiag.R b/tests/testthat/test-smk-ds.matrixDiag.R index c231f42d5..24db5db23 100644 --- a/tests/testthat/test-smk-ds.matrixDiag.R +++ b/tests/testthat/test-smk-ds.matrixDiag.R @@ -63,6 +63,19 @@ test_that("simplest ds.matrixDiag", { # context("ds.matrixDiag::smk::shutdown") +test_that("fails if the object does not exist", { + expect_error( + ds.matrixDiag(x1 = "nonexistent_object", aim = "serverside.matrix.2.vector"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + test_that("shutdown", { ds_expect_variables(c("D", "matrix_diag", "matrixdiag.newobj")) }) diff --git a/tests/testthat/test-smk-ds.matrixDimnames.R b/tests/testthat/test-smk-ds.matrixDimnames.R index 8dbc33082..8141332fa 100644 --- a/tests/testthat/test-smk-ds.matrixDimnames.R +++ b/tests/testthat/test-smk-ds.matrixDimnames.R @@ -51,6 +51,32 @@ test_that("simplest ds.matrixDimnames", { # context("ds.matrixDimnames::smk::shutdown") +test_that("fails if the object does not exist", { + expect_error( + ds.matrixDimnames(M1 = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.matrixDimnames(M1 = "D$LAB_TSC"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type matrix or data.frame. 'D$LAB_TSC' is type numeric.", fixed = TRUE) + } +}) + test_that("shutdown", { ds_expect_variables(c("D", "matrix.newobj", "matrixdimnames.newobj")) }) diff --git a/tests/testthat/test-smk-ds.matrixInvert.R b/tests/testthat/test-smk-ds.matrixInvert.R index a634a5d8c..d5805cdc9 100644 --- a/tests/testthat/test-smk-ds.matrixInvert.R +++ b/tests/testthat/test-smk-ds.matrixInvert.R @@ -48,6 +48,32 @@ test_that("simplest ds.matrixInvert", { # context("ds.matrixInvert::smk::shutdown") +test_that("fails if the object does not exist", { + expect_error( + ds.matrixInvert(M1 = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.matrixInvert(M1 = "D$LAB_TSC"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type matrix or data.frame. 'D$LAB_TSC' is type numeric.", fixed = TRUE) + } +}) + test_that("shutdown", { ds_expect_variables(c("D", "matrix.newobj", "matrixinvert.newobj")) }) diff --git a/tests/testthat/test-smk-ds.matrixMult.R b/tests/testthat/test-smk-ds.matrixMult.R index 0925fa0d1..3e5242b05 100644 --- a/tests/testthat/test-smk-ds.matrixMult.R +++ b/tests/testthat/test-smk-ds.matrixMult.R @@ -50,6 +50,32 @@ test_that("simplest ds.matrixMult", { # context("ds.matrixMult::smk::shutdown") +test_that("fails if the object does not exist", { + expect_error( + ds.matrixMult(M1 = "nonexistent_object", M2 = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.matrixMult(M1 = "D$LAB_TSC", M2 = "D$LAB_TSC"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type matrix or data.frame. 'D$LAB_TSC' is type numeric.", fixed = TRUE) + } +}) + test_that("shutdown", { ds_expect_variables(c("D", "mat1", "mat2", "matrixmult.newobj")) }) diff --git a/tests/testthat/test-smk-ds.matrixTranspose.R b/tests/testthat/test-smk-ds.matrixTranspose.R index 3cef80bff..193575994 100644 --- a/tests/testthat/test-smk-ds.matrixTranspose.R +++ b/tests/testthat/test-smk-ds.matrixTranspose.R @@ -48,6 +48,32 @@ test_that("simplest ds.matrixTranspose", { # context("ds.matrixTranspose::smk::shutdown") +test_that("fails if the object does not exist", { + expect_error( + ds.matrixTranspose(M1 = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.matrixTranspose(M1 = "D$LAB_TSC"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type matrix or data.frame. 'D$LAB_TSC' is type numeric.", fixed = TRUE) + } +}) + test_that("shutdown", { ds_expect_variables(c("D", "matrix.newobj", "matrixtranspose.newobj")) }) diff --git a/tests/testthat/test-smk-ds.mean.R b/tests/testthat/test-smk-ds.mean.R index 48dffa6f4..08736abb5 100644 --- a/tests/testthat/test-smk-ds.mean.R +++ b/tests/testthat/test-smk-ds.mean.R @@ -254,6 +254,19 @@ test_that("mean values [both]", { expect_true("Nvalid.study.specific" %in% ls.res$sim3$objects.found) }) +test_that("fails if the object does not exist", { + expect_error( + ds.mean(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.meanSdGp.R b/tests/testthat/test-smk-ds.meanSdGp.R index 14561fd09..451ef9474 100644 --- a/tests/testthat/test-smk-ds.meanSdGp.R +++ b/tests/testthat/test-smk-ds.meanSdGp.R @@ -67,6 +67,32 @@ test_that("meanSdGp values [both]", { expect_true("numeric" %in% class(stat.meanSdGp$Total_Ntotal)) }) +test_that("fails if the object does not exist", { + expect_error( + ds.meanSdGp(x = "nonexistent_object", y = "D$female"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.meanSdGp(x = "D", y = "D$female"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type numeric or integer. 'D' is type data.frame.", fixed = TRUE) + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.merge.R b/tests/testthat/test-smk-ds.merge.R index 31b6c8069..9b6cffb6c 100644 --- a/tests/testthat/test-smk-ds.merge.R +++ b/tests/testthat/test-smk-ds.merge.R @@ -44,6 +44,32 @@ test_that("simple test", { expect_equal(class.res$sim3, "data.frame") }) +test_that("fails if the object does not exist", { + expect_error( + ds.merge(x.name = "nonexistent_object", y.name = "D", by.x.names = "LAB_TSC", by.y.names = "LAB_TSC"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.merge(x.name = "D$LAB_TSC", y.name = "D", by.x.names = "LAB_TSC", by.y.names = "LAB_TSC"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type data.frame. 'D$LAB_TSC' is type numeric.", fixed = TRUE) + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.mice.R b/tests/testthat/test-smk-ds.mice.R index 71c0464a4..589a875a9 100644 --- a/tests/testthat/test-smk-ds.mice.R +++ b/tests/testthat/test-smk-ds.mice.R @@ -123,6 +123,32 @@ test_that("mice, second imputation", { }) +test_that("fails if the object does not exist", { + expect_error( + ds.mice(data = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.mice(data = "D$LAB_TSC"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type data.frame or matrix. 'D$LAB_TSC' is type numeric.", fixed = TRUE) + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.names.R b/tests/testthat/test-smk-ds.names.R index 71d93cdb4..865c8aec6 100644 --- a/tests/testthat/test-smk-ds.names.R +++ b/tests/testthat/test-smk-ds.names.R @@ -61,6 +61,19 @@ test_that("names, wrong input class returns a server error", { # context("ds.names::smk::shutdown") +test_that("fails if the object does not exist", { + expect_error( + ds.names(xname = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + test_that("shutdown", { ds_expect_variables(c("D", "my_newobj")) }) diff --git a/tests/testthat/test-smk-ds.numNA.R b/tests/testthat/test-smk-ds.numNA.R index 0c71e93f9..6452e04bd 100644 --- a/tests/testthat/test-smk-ds.numNA.R +++ b/tests/testthat/test-smk-ds.numNA.R @@ -49,6 +49,19 @@ test_that("simple numNA", { expect_equal(res3$sim3, 0) }) +test_that("fails if the object does not exist", { + expect_error( + ds.numNA(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.quantileMean.R b/tests/testthat/test-smk-ds.quantileMean.R index fad471d63..e31063baf 100644 --- a/tests/testthat/test-smk-ds.quantileMean.R +++ b/tests/testthat/test-smk-ds.quantileMean.R @@ -88,6 +88,19 @@ test_that("error, input must be numeric or integer", { expect_match(res.errors[[1]], "must be of type numeric or integer") }) +test_that("fails if the object does not exist", { + expect_error( + ds.quantileMean(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + test_that("shutdown", { ds_expect_variables(c("D", "hdl", "not_a_numeric")) }) diff --git a/tests/testthat/test-smk-ds.rbind.R b/tests/testthat/test-smk-ds.rbind.R index 627b5ffaa..1874841b3 100644 --- a/tests/testthat/test-smk-ds.rbind.R +++ b/tests/testthat/test-smk-ds.rbind.R @@ -38,6 +38,19 @@ test_that("simple test", { expect_true("matrix" %in% res1$survival3) }) +test_that("fails if the object does not exist", { + expect_error( + ds.rbind(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.reShape.R b/tests/testthat/test-smk-ds.reShape.R index dc6a80470..a43e65c1d 100644 --- a/tests/testthat/test-smk-ds.reShape.R +++ b/tests/testthat/test-smk-ds.reShape.R @@ -40,6 +40,19 @@ test_that("simplest ds.reShape, wide", { # expect_equal(res$validity.check, " appears valid in all sources") # }) +test_that("fails if the object does not exist", { + expect_error( + ds.reShape(data.name = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.recodeValues.R b/tests/testthat/test-smk-ds.recodeValues.R index a9ebd8930..fc1e27cd7 100644 --- a/tests/testthat/test-smk-ds.recodeValues.R +++ b/tests/testthat/test-smk-ds.recodeValues.R @@ -39,6 +39,32 @@ test_that("simple test", { expect_equal(new.res$survival3, "numeric") }) +test_that("fails if the object does not exist", { + expect_error( + ds.recodeValues(var.name = "nonexistent_object", values2replace.vector = c(1, 2), new.values.vector = c(3, 4)), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.recodeValues(var.name = "D", values2replace.vector = c(1, 2), new.values.vector = c(3, 4)), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type factor, character, numeric or integer. 'D' is type data.frame.", fixed = TRUE) + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.rep.R b/tests/testthat/test-smk-ds.rep.R index 076619b28..af4cc1866 100644 --- a/tests/testthat/test-smk-ds.rep.R +++ b/tests/testthat/test-smk-ds.rep.R @@ -32,6 +32,19 @@ test_that("simple test", { ds_expect_variables(c("D", "seq.vect")) }) +test_that("fails if the object does not exist", { + expect_error( + ds.rep(x1 = "nonexistent_object", times = 2, source.x1 = "serverside", source.times = "clientside"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.replaceNA.R b/tests/testthat/test-smk-ds.replaceNA.R index 04bdfdf45..c40bf97dc 100644 --- a/tests/testthat/test-smk-ds.replaceNA.R +++ b/tests/testthat/test-smk-ds.replaceNA.R @@ -37,6 +37,19 @@ test_that("simple replaceNA", { expect_length(res3, 0) }) +test_that("fails if the object does not exist", { + expect_error( + ds.replaceNA(x = "nonexistent_object", forNA = list(1, 1, 1)), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.seq.R b/tests/testthat/test-smk-ds.seq.R index e0fb65a07..b7a3c87e0 100644 --- a/tests/testthat/test-smk-ds.seq.R +++ b/tests/testthat/test-smk-ds.seq.R @@ -44,6 +44,19 @@ test_that("simplest ds.seq", { # context("ds.seq::smk::shutdown") +test_that("fails if the object does not exist", { + expect_error( + ds.seq(FROM.value.char = "1", ALONG.WITH.name = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + test_that("shutdown", { ds_expect_variables(c("D", "obj1", "obj2")) }) diff --git a/tests/testthat/test-smk-ds.skewness.R b/tests/testthat/test-smk-ds.skewness.R index 416bc79df..f7c0c54d3 100644 --- a/tests/testthat/test-smk-ds.skewness.R +++ b/tests/testthat/test-smk-ds.skewness.R @@ -790,6 +790,32 @@ test_that("simple skewness, method 3, both, on PM_BMI_CONTINUOUS", { expect_equal(skewness.res$Global.Skewness$Nvalid[1], 8927) }) +test_that("fails if the object does not exist", { + expect_error( + ds.skewness(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.skewness(x = "D"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type numeric or integer. 'D' is type data.frame.", fixed = TRUE) + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.sqrt.R b/tests/testthat/test-smk-ds.sqrt.R index 260da9470..88feebf1e 100644 --- a/tests/testthat/test-smk-ds.sqrt.R +++ b/tests/testthat/test-smk-ds.sqrt.R @@ -45,6 +45,32 @@ test_that("simple c", { expect_equal(res.class$sim3, "numeric") }) +test_that("fails if the object does not exist", { + expect_error( + ds.sqrt(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + +test_that("fails if the object is the wrong type", { + expect_error( + ds.sqrt(x = "D"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object must be of type numeric or integer. 'D' is type data.frame.", fixed = TRUE) + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.summary.R b/tests/testthat/test-smk-ds.summary.R index 750c0392d..31aa119ee 100644 --- a/tests/testthat/test-smk-ds.summary.R +++ b/tests/testthat/test-smk-ds.summary.R @@ -125,6 +125,19 @@ test_that("summary_data_frame", { # context("ds.summary::smk::teardown") +test_that("fails if the object does not exist", { + expect_error( + ds.summary(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + test_that("shutdown", { ds_expect_variables(c("D", "a_character", "a_factor", "a_list")) }) diff --git a/tests/testthat/test-smk-ds.unList.R b/tests/testthat/test-smk-ds.unList.R index c8fdcd692..f7ceec44a 100644 --- a/tests/testthat/test-smk-ds.unList.R +++ b/tests/testthat/test-smk-ds.unList.R @@ -34,6 +34,19 @@ test_that("simple test", { ds_expect_variables(c("D", "GENDER.list", "unlist.newobj")) }) +test_that("fails if the object does not exist", { + expect_error( + ds.unList(x.name = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.unique.R b/tests/testthat/test-smk-ds.unique.R index 21f6f5f03..1f868e8b8 100644 --- a/tests/testthat/test-smk-ds.unique.R +++ b/tests/testthat/test-smk-ds.unique.R @@ -48,6 +48,19 @@ test_that("simple test", { expect_equal(unique.newobj.length$`total length of unique.newobj in all studies combined`, 6) }) +test_that("fails if the object does not exist", { + expect_error( + ds.unique(x.name = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done # diff --git a/tests/testthat/test-smk-ds.var.R b/tests/testthat/test-smk-ds.var.R index 63ea16ff5..9bdabb827 100644 --- a/tests/testthat/test-smk-ds.var.R +++ b/tests/testthat/test-smk-ds.var.R @@ -85,6 +85,19 @@ test_that("simple var, both", { expect_equal(var.res$Nstudies, 3) }) +test_that("fails if the object does not exist", { + expect_error( + ds.var(x = "nonexistent_object"), + "There are some DataSHIELD errors, list them with datashield.errors()", + fixed = TRUE + ) + + res.errors <- DSI::datashield.errors() + for (study.errors in res.errors) { + expect_match(study.errors, "The server-side object 'nonexistent_object' does not exist") + } +}) + # # Done #