Skip to content

Commit

Permalink
Remove PL for module install; test RS on Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonysena committed Dec 19, 2023
1 parent 28bacf4 commit 4805086
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 88 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/R_CMD_check_Hades.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 0 additions & 6 deletions R/ModuleInstantiation.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
156 changes: 78 additions & 78 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4805086

Please sign in to comment.