From a59d13e33b94cd2494cfd526135c48fc68c616c4 Mon Sep 17 00:00:00 2001 From: Anthony Sena Date: Fri, 13 Sep 2024 15:06:12 -0400 Subject: [PATCH] Remove old test scripts from test resources --- inst/testdata/plpvmodule/test-eunomia.R | 35 -------------------- inst/testdata/plpvmodule/testJobContext.rds | Bin 1574 -> 0 bytes inst/testdata/plpvmodule/testScript.R | 10 ------ 3 files changed, 45 deletions(-) delete mode 100644 inst/testdata/plpvmodule/test-eunomia.R delete mode 100644 inst/testdata/plpvmodule/testJobContext.rds delete mode 100644 inst/testdata/plpvmodule/testScript.R 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 8d30b016df9d3fde058b75bc16900a5595f6e1dc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1574 zcmV+>2HE)^iwFP!000001MOH}Z`(EySDimgy{1jupvCsE8GhbsyGBKje=o5|@v8}WtltXdtJ-D$TT=v=O=v?C zpP+GCvHI)lVyRR%uxmokA3&d$zbXC1M5WT}@S7=-#bnj5yJn;ym z6k(SE{@jBdwh_J$*)tq%sHR)a6za;F4Z2)cf}dKTYp zGmQ@vl`U5pDY)@rqSwZ5|u)Y11sV`gU8F|^U$(_07~k(2`jh8vz5k=w zS^uPiiBnGD&Wm}^2gRg>e;;u39s9ir~%oaJ?J8<(hWD;r+md;pvN_Z$Ot~ zg4}5${!)c)8+a5l9`G4}CNd*5a;;`x7o}2W>F5C&`18aP^XNuW({lD92|WVtG&J-0 z(fvEsJJoXWoKaCB!B=aXWvJk)6(QU(@gXKG%VJ!N#vKL~lC4P6fD_~*o?#~Ya}h`0 zRRmY#v#n3zPBpDv`+Z52OQKv70>R=F=K_&E7S?mZ(o@S-NNpjJQRwsPsO z|F@IeQv^5Con#N#Fpc=+w`Dh3c9Uf{S$30UH%Z_`elxLp23-r1(xcLz-fn(40gK#H zFj-u*xWbNmnIo@KWBq=0_a88l8B-xi;8L_GJk5b+ct$`K z9DlbVhbt17^jpgr7sbDku?=nhQTM+lU$m(oSf{M_vE2Y)M(|1~ZMs%Mc74Lhl~FLJ z0fAlDJ{5}1V?Yma;P+VN;5aK3IGzm$=nO_H7u3k#W_;ljWcoeZW6Jq5t8h8d+rTcIYIJ|)^@bbotUpT_Gava=D zub=yzmyIMY%Jv`Vt)iP(!t71DGWLIwe#R0oehE#VzCiwAc=-@U1!~(%$l4emje&V2*CX&% zfCwBS2kL$wQK{H;ked-+BkVb%ps?U&frL@eU6X}GPM;&$A&~#uGd514ZpjKB0y4xA zC2;tHO7gH5*g2JydoDMaPg6K&xeXlf{m0{lr)P25Uf@Pp&_%`RHH)2&Q$@Jy0OaP& zLQY#(bn8*IDN@1GBP1_rivG5$AF(Y5wrb{92FB9qQw6mxP&7L1xtN;*V}`9tLQ>gT zmn9QHhhS{O^a}BnGpYMr(e=ZPBoUt}hyh75ov5o z&PajU6~>sA3AWjtgjOEZD?6`F&Z@IB>+V_2@*j+6FYoO>e0glwtL!uND#J>p?>k=i zi8X8QRgN(^8c*ubtkrjG4=0N4-hZ+k6$a(zYjty6zXz>&FF(K0a)_-s&y4Fb@?jxw zKp!BR_TdB)$lk=|dEt)p6E+6y7Gxem2gFwg%gI%2C90zX=ImJHrk;j-jCm&VJSDus zxXXaHZQ#I_9JR@(GNMcYx5R8!UbKW)EtQL8Puw;vr+EU+Acr8XXBAnRl9#b-H231O YLDM#GJJ@2cV7Zq62H`12M{XSe0L2jwi2wiq 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