Skip to content

Commit

Permalink
Force module instantiation before execution in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonysena committed Aug 17, 2023
1 parent 839b46a commit deab430
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ License: Apache License 2.0
URL: https://ohdsi.github.io/Strategus, https://github.com/OHDSI/Strategus
BugReports: https://github.com/OHDSI/Strategus/issues
Depends:
R (>= 4.2.3),
R (>= 4.2.0),
CohortGenerator (>= 0.8.0),
DatabaseConnector (>= 6.2.3)
Imports:
Expand Down
5 changes: 4 additions & 1 deletion tests/testthat/test-Strategus.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@ test_that("Run Eunomia study", {
)
)

# Ensure all of the modules are instantiated
analysisSpecifications$moduleSpecifications <- analysisSpecifications$moduleSpecifications[-c(2:length(analysisSpecifications$moduleSpecifications))]
ensureAllModulesInstantiated(analysisSpecifications)

# Create a unique set of cohort tables for this test run and
# ensure they are removed when complete
cohortTableNames <- CohortGenerator::getCohortTableNames(cohortTable = paste0("s", tableSuffix))

# Use this line to limit to only running the CohortGeneratorModule
# for testing purposes.
analysisSpecifications$moduleSpecifications <- analysisSpecifications$moduleSpecifications[-c(2:length(analysisSpecifications$moduleSpecifications))]
executionSettings <- createCdmExecutionSettings(
connectionDetailsReference = dbms,
workDatabaseSchema = workDatabaseSchema,
Expand Down

0 comments on commit deab430

Please sign in to comment.