diff --git a/inst/testdata/plpvmodule/test-eunomia.R b/inst/testdata/plpvmodule/test-eunomia.R deleted file mode 100644 index a326b8a9..00000000 --- a/inst/testdata/plpvmodule/test-eunomia.R +++ /dev/null @@ -1,35 +0,0 @@ -library(testthat) -library(Eunomia) -connectionDetails <- getEunomiaConnectionDetails() -Eunomia::createCohorts(connectionDetails = connectionDetails) - -workFolder <- tempfile("work") -dir.create(workFolder) -resultsfolder <- tempfile("results") -dir.create(resultsfolder) -jobContext <- readRDS("tests/testJobContext.rds") -jobContext$moduleExecutionSettings$workSubFolder <- workFolder -jobContext$moduleExecutionSettings$resultsSubFolder <- resultsfolder -jobContext$moduleExecutionSettings$connectionDetails <- connectionDetails - -# add model to folder -plpModel <- readRDS("tests/plpModel.rds") -upperWorkDir <- dirname(workFolder) -dir.create(file.path(upperWorkDir,'ModelTransferModule_1')) -modelTransferFolder <- sort(dir(upperWorkDir, pattern = 'ModelTransferModule'), decreasing = T)[1] -modelSaveLocation <- file.path( upperWorkDir, modelTransferFolder, 'models') # hack to use work folder for model transfer -PatientLevelPrediction::savePlpModel( - plpModel, - file.path(modelSaveLocation, 'model_1_1') - ) - -test_that("Run module", { - source("Main.R") - execute(jobContext) - resultsFiles <- list.files(resultsfolder) - expect_true("performances.csv" %in% resultsFiles) -}) - -unlink(workFolder) -unlink(resultsfolder) -unlink(connectionDetails$server()) diff --git a/inst/testdata/plpvmodule/testJobContext.rds b/inst/testdata/plpvmodule/testJobContext.rds deleted file mode 100644 index 8d30b016..00000000 Binary files a/inst/testdata/plpvmodule/testJobContext.rds and /dev/null differ diff --git a/inst/testdata/plpvmodule/testScript.R b/inst/testdata/plpvmodule/testScript.R deleted file mode 100644 index 02d8c189..00000000 --- a/inst/testdata/plpvmodule/testScript.R +++ /dev/null @@ -1,10 +0,0 @@ -library(testthat) - -testFiles <- list.files(file.path("tests"), "test-.*\\.R", full.names = TRUE) -for (testFile in testFiles) { - message(sprintf("*** Running tests in '%s' ***", testFile)) - source(testFile) -} - - -# Note: testthat default structure does not work for non-packages: https://github.com/r-lib/testthat/issues/1490