From 4805086133eca5d9a527db049553a605e2740671 Mon Sep 17 00:00:00 2001 From: Anthony Sena Date: Tue, 19 Dec 2023 10:45:12 -0500 Subject: [PATCH] Remove PL for module install; test RS on Ubuntu --- .github/workflows/R_CMD_check_Hades.yaml | 8 +- R/ModuleInstantiation.R | 6 - tests/testthat/setup.R | 156 +++++++++++------------ 3 files changed, 82 insertions(+), 88 deletions(-) diff --git a/.github/workflows/R_CMD_check_Hades.yaml b/.github/workflows/R_CMD_check_Hades.yaml index db1df5be..8f7d37e0 100644 --- a/.github/workflows/R_CMD_check_Hades.yaml +++ b/.github/workflows/R_CMD_check_Hades.yaml @@ -20,12 +20,12 @@ jobs: fail-fast: false matrix: config: - - {os: windows-latest, r: '4.2.3', rtools: '42', rspm: "https://cloud.r-project.org"} - - {os: macOS-latest, r: '4.2.3', rtools: '42', rspm: "https://cloud.r-project.org"} + #- {os: windows-latest, r: '4.2.3', rtools: '42', rspm: "https://cloud.r-project.org"} + #- {os: macOS-latest, r: '4.2.3', rtools: '42', rspm: "https://cloud.r-project.org"} - {os: ubuntu-20.04, r: '4.2.3', rtools: '42', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - - {os: windows-latest, r: 'release', rtools: '', rspm: "https://cloud.r-project.org"} + #- {os: windows-latest, r: 'release', rtools: '', rspm: "https://cloud.r-project.org"} #- {os: macOS-latest, r: 'release', rtools: '', rspm: "https://cloud.r-project.org"} - - {os: ubuntu-20.04, r: 'release', rtools: '', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + #- {os: ubuntu-20.04, r: 'release', rtools: '', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} env: GITHUB_PAT: ${{ secrets.GH_TOKEN }} diff --git a/R/ModuleInstantiation.R b/R/ModuleInstantiation.R index 9db6724f..efb899af 100644 --- a/R/ModuleInstantiation.R +++ b/R/ModuleInstantiation.R @@ -418,12 +418,6 @@ instantiateModule <- function(module, version, remoteRepo, remoteUsername, modul withModuleRenv( code = { - ParallelLogger::addDefaultFileLogger( - fileName = file.path(moduleFolder, "moduleInitLog.txt") - ) - ParallelLogger::addDefaultErrorReportLogger( - fileName = file.path(moduleFolder, "moduleInitErrorReport.txt") - ) renv::restore(prompt = FALSE) }, moduleFolder = moduleFolder, diff --git a/tests/testthat/setup.R b/tests/testthat/setup.R index a7ece606..4158d21f 100644 --- a/tests/testthat/setup.R +++ b/tests/testthat/setup.R @@ -76,102 +76,102 @@ connectionDetailsList[[length(connectionDetailsList) + 1]] <- list( tempEmulationSchema = NULL ) -# PostgreSQL -if (!(Sys.getenv("CDM5_POSTGRESQL_USER") == "" & - Sys.getenv("CDM5_POSTGRESQL_PASSWORD") == "" & - Sys.getenv("CDM5_POSTGRESQL_SERVER") == "" & - Sys.getenv("CDM5_POSTGRESQL_CDM_SCHEMA") == "" & - Sys.getenv("CDM5_POSTGRESQL_OHDSI_SCHEMA") == "")) { - DatabaseConnector::downloadJdbcDrivers("postgresql") - connectionDetailsList[[length(connectionDetailsList) + 1]] <- list( - connectionDetails = DatabaseConnector::createConnectionDetails( - dbms = "postgresql", - user = Sys.getenv("CDM5_POSTGRESQL_USER"), - password = URLdecode(Sys.getenv("CDM5_POSTGRESQL_PASSWORD")), - server = Sys.getenv("CDM5_POSTGRESQL_SERVER"), - port = 5432, - pathToDriver = Sys.getenv("DATABASECONNECTOR_JAR_FOLDER") - ), - cdmDatabaseSchema = Sys.getenv("CDM5_POSTGRESQL_CDM_SCHEMA"), - workDatabaseSchema = Sys.getenv("CDM5_POSTGRESQL_OHDSI_SCHEMA"), - vocabularyDatabaseSchema = Sys.getenv("CDM5_POSTGRESQL_CDM_SCHEMA"), - cohortTable = "cohort", - tempEmulationSchema = NULL - ) -} - -# Oracle -if (!(Sys.getenv("CDM5_ORACLE_USER") == "" & - Sys.getenv("CDM5_ORACLE_PASSWORD") == "" & - Sys.getenv("CDM5_ORACLE_SERVER") == "" & - Sys.getenv("CDM5_ORACLE_CDM_SCHEMA") == "" & - Sys.getenv("CDM5_ORACLE_OHDSI_SCHEMA") == "")) { - DatabaseConnector::downloadJdbcDrivers("oracle") - connectionDetailsList[[length(connectionDetailsList) + 1]] <- list( - connectionDetails = DatabaseConnector::createConnectionDetails( - dbms = "oracle", - user = Sys.getenv("CDM5_ORACLE_USER"), - password = URLdecode(Sys.getenv("CDM5_ORACLE_PASSWORD")), - server = Sys.getenv("CDM5_ORACLE_SERVER"), - port = 1521, - pathToDriver = Sys.getenv("DATABASECONNECTOR_JAR_FOLDER") - ), - cdmDatabaseSchema = Sys.getenv("CDM5_ORACLE_CDM_SCHEMA"), - workDatabaseSchema = Sys.getenv("CDM5_ORACLE_OHDSI_SCHEMA"), - vocabularyDatabaseSchema = Sys.getenv("CDM5_ORACLE_CDM_SCHEMA"), - cohortTable = "cohort", - tempEmulationSchema = Sys.getenv("CDM5_ORACLE_OHDSI_SCHEMA") - ) -} - -# RedShift -# if (!(Sys.getenv("CDM5_REDSHIFT_USER") == "" & -# Sys.getenv("CDM5_REDSHIFT_PASSWORD") == "" & -# Sys.getenv("CDM5_REDSHIFT_SERVER") == "" & -# Sys.getenv("CDM5_REDSHIFT_CDM_SCHEMA") == "" & -# Sys.getenv("CDM5_REDSHIFT_OHDSI_SCHEMA") == "")) { -# DatabaseConnector::downloadJdbcDrivers("redshift") +# # PostgreSQL +# if (!(Sys.getenv("CDM5_POSTGRESQL_USER") == "" & +# Sys.getenv("CDM5_POSTGRESQL_PASSWORD") == "" & +# Sys.getenv("CDM5_POSTGRESQL_SERVER") == "" & +# Sys.getenv("CDM5_POSTGRESQL_CDM_SCHEMA") == "" & +# Sys.getenv("CDM5_POSTGRESQL_OHDSI_SCHEMA") == "")) { +# DatabaseConnector::downloadJdbcDrivers("postgresql") # connectionDetailsList[[length(connectionDetailsList) + 1]] <- list( # connectionDetails = DatabaseConnector::createConnectionDetails( -# dbms = "redshift", -# user = Sys.getenv("CDM5_REDSHIFT_USER"), -# password = URLdecode(Sys.getenv("CDM5_REDSHIFT_PASSWORD")), -# server = Sys.getenv("CDM5_REDSHIFT_SERVER"), -# port = 5439, +# dbms = "postgresql", +# user = Sys.getenv("CDM5_POSTGRESQL_USER"), +# password = URLdecode(Sys.getenv("CDM5_POSTGRESQL_PASSWORD")), +# server = Sys.getenv("CDM5_POSTGRESQL_SERVER"), +# port = 5432, # pathToDriver = Sys.getenv("DATABASECONNECTOR_JAR_FOLDER") # ), -# cdmDatabaseSchema = Sys.getenv("CDM5_REDSHIFT_CDM_SCHEMA"), -# workDatabaseSchema = Sys.getenv("CDM5_REDSHIFT_OHDSI_SCHEMA"), -# vocabularyDatabaseSchema = Sys.getenv("CDM5_REDSHIFT_CDM_SCHEMA"), +# cdmDatabaseSchema = Sys.getenv("CDM5_POSTGRESQL_CDM_SCHEMA"), +# workDatabaseSchema = Sys.getenv("CDM5_POSTGRESQL_OHDSI_SCHEMA"), +# vocabularyDatabaseSchema = Sys.getenv("CDM5_POSTGRESQL_CDM_SCHEMA"), # cohortTable = "cohort", # tempEmulationSchema = NULL # ) # } +# +# # Oracle +# if (!(Sys.getenv("CDM5_ORACLE_USER") == "" & +# Sys.getenv("CDM5_ORACLE_PASSWORD") == "" & +# Sys.getenv("CDM5_ORACLE_SERVER") == "" & +# Sys.getenv("CDM5_ORACLE_CDM_SCHEMA") == "" & +# Sys.getenv("CDM5_ORACLE_OHDSI_SCHEMA") == "")) { +# DatabaseConnector::downloadJdbcDrivers("oracle") +# connectionDetailsList[[length(connectionDetailsList) + 1]] <- list( +# connectionDetails = DatabaseConnector::createConnectionDetails( +# dbms = "oracle", +# user = Sys.getenv("CDM5_ORACLE_USER"), +# password = URLdecode(Sys.getenv("CDM5_ORACLE_PASSWORD")), +# server = Sys.getenv("CDM5_ORACLE_SERVER"), +# port = 1521, +# pathToDriver = Sys.getenv("DATABASECONNECTOR_JAR_FOLDER") +# ), +# cdmDatabaseSchema = Sys.getenv("CDM5_ORACLE_CDM_SCHEMA"), +# workDatabaseSchema = Sys.getenv("CDM5_ORACLE_OHDSI_SCHEMA"), +# vocabularyDatabaseSchema = Sys.getenv("CDM5_ORACLE_CDM_SCHEMA"), +# cohortTable = "cohort", +# tempEmulationSchema = Sys.getenv("CDM5_ORACLE_OHDSI_SCHEMA") +# ) +# } -# SQL Server -if (!(Sys.getenv("CDM5_SQL_SERVER_USER") == "" & - Sys.getenv("CDM5_SQL_SERVER_PASSWORD") == "" & - Sys.getenv("CDM5_SQL_SERVER_SERVER") == "" & - Sys.getenv("CDM5_SQL_SERVER_CDM_SCHEMA") == "" & - Sys.getenv("CDM5_SQL_SERVER_OHDSI_SCHEMA") == "")) { - DatabaseConnector::downloadJdbcDrivers("sql server") +# RedShift +if (!(Sys.getenv("CDM5_REDSHIFT_USER") == "" & + Sys.getenv("CDM5_REDSHIFT_PASSWORD") == "" & + Sys.getenv("CDM5_REDSHIFT_SERVER") == "" & + Sys.getenv("CDM5_REDSHIFT_CDM_SCHEMA") == "" & + Sys.getenv("CDM5_REDSHIFT_OHDSI_SCHEMA") == "")) { + DatabaseConnector::downloadJdbcDrivers("redshift") connectionDetailsList[[length(connectionDetailsList) + 1]] <- list( connectionDetails = DatabaseConnector::createConnectionDetails( - dbms = "sql server", - user = Sys.getenv("CDM5_SQL_SERVER_USER"), - password = URLdecode(Sys.getenv("CDM5_SQL_SERVER_PASSWORD")), - server = Sys.getenv("CDM5_SQL_SERVER_SERVER"), - port = 1433, + dbms = "redshift", + user = Sys.getenv("CDM5_REDSHIFT_USER"), + password = URLdecode(Sys.getenv("CDM5_REDSHIFT_PASSWORD")), + server = Sys.getenv("CDM5_REDSHIFT_SERVER"), + port = 5439, pathToDriver = Sys.getenv("DATABASECONNECTOR_JAR_FOLDER") ), - cdmDatabaseSchema = Sys.getenv("CDM5_SQL_SERVER_CDM_SCHEMA"), - workDatabaseSchema = Sys.getenv("CDM5_SQL_SERVER_OHDSI_SCHEMA"), - vocabularyDatabaseSchema = Sys.getenv("CDM5_SQL_SERVER_CDM_SCHEMA"), + cdmDatabaseSchema = Sys.getenv("CDM5_REDSHIFT_CDM_SCHEMA"), + workDatabaseSchema = Sys.getenv("CDM5_REDSHIFT_OHDSI_SCHEMA"), + vocabularyDatabaseSchema = Sys.getenv("CDM5_REDSHIFT_CDM_SCHEMA"), cohortTable = "cohort", tempEmulationSchema = NULL ) } +# # SQL Server +# if (!(Sys.getenv("CDM5_SQL_SERVER_USER") == "" & +# Sys.getenv("CDM5_SQL_SERVER_PASSWORD") == "" & +# Sys.getenv("CDM5_SQL_SERVER_SERVER") == "" & +# Sys.getenv("CDM5_SQL_SERVER_CDM_SCHEMA") == "" & +# Sys.getenv("CDM5_SQL_SERVER_OHDSI_SCHEMA") == "")) { +# DatabaseConnector::downloadJdbcDrivers("sql server") +# connectionDetailsList[[length(connectionDetailsList) + 1]] <- list( +# connectionDetails = DatabaseConnector::createConnectionDetails( +# dbms = "sql server", +# user = Sys.getenv("CDM5_SQL_SERVER_USER"), +# password = URLdecode(Sys.getenv("CDM5_SQL_SERVER_PASSWORD")), +# server = Sys.getenv("CDM5_SQL_SERVER_SERVER"), +# port = 1433, +# pathToDriver = Sys.getenv("DATABASECONNECTOR_JAR_FOLDER") +# ), +# cdmDatabaseSchema = Sys.getenv("CDM5_SQL_SERVER_CDM_SCHEMA"), +# workDatabaseSchema = Sys.getenv("CDM5_SQL_SERVER_OHDSI_SCHEMA"), +# vocabularyDatabaseSchema = Sys.getenv("CDM5_SQL_SERVER_CDM_SCHEMA"), +# cohortTable = "cohort", +# tempEmulationSchema = NULL +# ) +# } + # Keyring helpers -------------- # Set the keyring name & password for testing keyringName <- "strategus"