From 1e96f0de092e5e13b008e1918131ead0fdea7afe Mon Sep 17 00:00:00 2001 From: Anthony Sena Date: Tue, 16 Jan 2024 19:46:35 -0500 Subject: [PATCH] Move cohort table name call to setup --- tests/testthat/setup.R | 4 ++-- tests/testthat/test-Strategus.R | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/testthat/setup.R b/tests/testthat/setup.R index 5579e3eb..be4a4290 100644 --- a/tests/testthat/setup.R +++ b/tests/testthat/setup.R @@ -68,7 +68,7 @@ withr::defer( cdmDatabaseSchema <- "main" workDatabaseSchema <- "main" vocabularyDatabaseSchema <- workDatabaseSchema -cohortTable <- "cohort" +cohortTableNames <- CohortGenerator::getCohortTableNames(cohortTable = paste0("s", tableSuffix)) tempEmulationSchema <- NULL connectionDetailsList[[length(connectionDetailsList) + 1]] <- list( @@ -76,7 +76,7 @@ connectionDetailsList[[length(connectionDetailsList) + 1]] <- list( cdmDatabaseSchema = "main", workDatabaseSchema = "main", vocabularyDatabaseSchema = "main", - cohortTable = "cohort", + cohortTableNames = cohortTableNames, tempEmulationSchema = NULL ) # diff --git a/tests/testthat/test-Strategus.R b/tests/testthat/test-Strategus.R index 80691eff..82710a8f 100644 --- a/tests/testthat/test-Strategus.R +++ b/tests/testthat/test-Strategus.R @@ -28,6 +28,7 @@ test_that("Run unit test study", { workDatabaseSchema <- connectionDetailsList[[i]]$workDatabaseSchema cdmDatabaseSchema <- connectionDetailsList[[i]]$cdmDatabaseSchema tempEmulationSchema <- connectionDetailsList[[i]]$tempEmulationSchema + cohortTableNames <- connectionDetailsList[[i]]$cohortTableNames studyRootFolder <- file.path(tempDir, "EunomiaTestStudy", dbms) workFolder <- file.path(studyRootFolder, "work_folder") resultsFolder <- file.path(studyRootFolder, "results_folder") @@ -72,7 +73,7 @@ test_that("Run unit test study", { workDatabaseSchema = workDatabaseSchema, cdmDatabaseSchema = cdmDatabaseSchema, tempEmulationSchema = tempEmulationSchema, - cohortTableNames = CohortGenerator::getCohortTableNames(cohortTable = paste0("s", tableSuffix)), + cohortTableNames = cohortTableNames, workFolder = workFolder, resultsFolder = resultsFolder, minCellCount = 5,