From 2b0acc8d53dc30e21c9d1f6db9b94d9cdfcd49f5 Mon Sep 17 00:00:00 2001 From: Adam Black Date: Thu, 19 Aug 2021 18:49:15 -0400 Subject: [PATCH] update setup file --- tests/setup.R | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/tests/setup.R b/tests/setup.R index 762a4ee..dccdb76 100644 --- a/tests/setup.R +++ b/tests/setup.R @@ -1,8 +1,47 @@ # Download the JDBC drivers used in the tests +library(DatabaseConnector) driverPath <- file.path(Sys.getenv("HOME"), "drivers") if(!dir.exists(driverPath)) dir.create(driverPath) if(Sys.getenv("LOCAL_TEST") != "TRUE") { - DatabaseConnector::downloadJdbcDrivers("all", pathToDriver = driverPath) + cat("downloading drivers") + downloadJdbcDrivers("all", pathToDriver = driverPath) } + + +postgresDetails <- createConnectionDetails( + dbms = "postgresql", + user = Sys.getenv("CDMDDLBASE_POSTGRESQL_USER"), + password = Sys.getenv("CDMDDLBASE_POSTGRESQL_PASSWORD"), + server = Sys.getenv("CDMDDLBASE_POSTGRESQL_SERVER"), + pathToDriver = file.path(Sys.getenv("HOME"), "drivers"), + cdmSchema = Sys.getenv("CDMDDLBASE_POSTGRESQL_SCHEMA") +) + +redshiftDetails <- createConnectionDetails( + dbms = "redshift", + user = Sys.getenv("CDMDDLBASE_REDSHIFT_USER"), + password = Sys.getenv("CDMDDLBASE_REDSHIFT_PASSWORD"), + server = Sys.getenv("CDMDDLBASE_REDSHIFT_SERVER"), + pathToDriver = file.path(Sys.getenv("HOME"), "drivers"), + cdmSchema = Sys.getenv("CDMDDLBASE_REDSHIFT_SCHEMA") +) + +sqlserverDetails <- createConnectionDetails( + dbms = "sql server", + user = Sys.getenv("CDMDDLBASE_SQL_SERVER_USER"), + password = Sys.getenv("CDMDDLBASE_SQL_SERVER_PASSWORD"), + server = Sys.getenv("CDMDDLBASE_SQL_SERVER_SERVER"), + pathToDriver = file.path(Sys.getenv("HOME"), "drivers"), + cdmSchema = Sys.getenv("CDMDDLBASE_SQL_SERVER_CDM_SCHEMA") +) + +oracleDetails <- createConnectionDetails( + dbms = "oracle", + user = Sys.getenv("CDMDDLBASE_ORACLE_USER"), + password = Sys.getenv("CDMDDLBASE_ORACLE_PASSWORD"), + server = Sys.getenv("CDMDDLBASE_ORACLE_SERVER"), + pathToDriver = file.path(Sys.getenv("HOME"), "drivers"), + cdmSchema = Sys.getenv("CDMDDLBASE_ORACLE_CDM_SCHEMA") +)