Skip to content

Commit

Permalink
fix actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ablack3 committed Dec 13, 2023
1 parent c41858a commit b7fda01
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
install.packages("bigrquery")
install.packages("arrow")
install.packages("tibble")
install.packages("visR")
shell: Rscript {0}

- name: Install CirceR
Expand Down
29 changes: 25 additions & 4 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,27 @@ tryCatch({

# functions used for the test matrix

get_connection <- function(dbms) {
get_connection <- function(dbms, DatabaseConnector = FALSE) {

if (DatabaseConnector) {
stop(dbms %in% c("postgres"), rlang::is_installed("DatabaseConnector"))


if (dbms == "postgres") {

DatabaseConnector::connect(dbms = "postgresql",
server = Sys.getenv("CDM5_POSTGRESQL_SERVER"),
user = Sys.getenv("CDM5_POSTGRESQL_USER"),
password = Sys.getenv("CDM5_POSTGRESQL_PASSWORD"))

}

stop(paste("Testing", dbms, "with DatabaseConnector has not been implemented yet."))

}



if (dbms == "duckdb") {
return(DBI::dbConnect(duckdb::duckdb(), eunomia_dir()))
}
Expand Down Expand Up @@ -68,7 +88,7 @@ get_connection <- function(dbms) {
))
}

if (dbms == "snowflake" && "Snowflake" %in% odbc::odbcListDataSources()$name) {
if (dbms == "snowflake" && Sys.getenv("SNOWFLAKE_USER") != "") {
# return(DBI::dbConnect(odbc::odbc(), "Snowflake",
# pwd = Sys.getenv("SNOWFLAKE_PASSWORD")))
return(DBI::dbConnect(odbc::odbc(),
Expand Down Expand Up @@ -145,11 +165,12 @@ ciTestDbs <- c("duckdb", "postgres", "redshift", "sqlserver", "snowflake")

if (Sys.getenv("CI_TEST_DB") == "") {
dbToTest <- c(
"duckdb"
# "duckdb"
# ,
# "postgres"
# ,"redshift"
# ,"sqlserver"
# ,
"sqlserver"
# ,"snowflake"

# ,"spark"
Expand Down

0 comments on commit b7fda01

Please sign in to comment.