Skip to content

Commit

Permalink
skip db tests on cran
Browse files Browse the repository at this point in the history
  • Loading branch information
ablack3 committed Jan 16, 2024
1 parent 9cbb817 commit 269c3dd
Show file tree
Hide file tree
Showing 19 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/testthat/test-db-DBI.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ test_dbi <- function(con, cdm_schema, write_schema) {
for (dbtype in dbToTest) {
test_that(glue::glue("{dbtype} - dbi"), {
if (!(dbtype %in% ciTestDbs)) skip_on_ci()

if (dbtype != "duckdb") skip_on_cran()
write_schema <- get_write_schema(dbtype)
cdm_schema <- get_cdm_schema(dbtype)
con <- get_connection(dbtype)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-db-casing.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ test_lowercase <- function(con, cdm_schema, write_schema) {
for (dbtype in dbToTest) {
test_that(glue::glue("{dbtype} - lowercase columns"), {
if (!(dbtype %in% ciTestDbs)) skip_on_ci()
if (dbtype != "duckdb") skip_on_cran()
con <- get_connection(dbtype)
cdm_schema <- get_cdm_schema(dbtype)
write_schema <- get_write_schema(dbtype)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-db-cdm.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ test_cdm_from_con <- function(con, cdm_schema, write_schema) {
for (dbtype in dbToTest) {
test_that(glue::glue("{dbtype} - cdm_from_con"), {
if (!(dbtype %in% ciTestDbs)) skip_on_ci()
if (dbtype != "duckdb") skip_on_cran()
con <- get_connection(dbtype)
cli::cat_rule(paste("running cdm test on ", dbtype))
cli::cat_line(paste("DBI::dbIsValid(con):", DBI::dbIsValid(con)))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-db-cohortTransformations.R
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ test_cohort_collapse <- function(con, write_schema) {
for (dbtype in dbToTest) {
test_that(glue::glue("{dbtype} - cohort_collapse"), {
if (!(dbtype %in% ciTestDbs)) skip_on_ci()
if (dbtype != "duckdb") skip_on_cran()
write_schema <- get_write_schema(dbtype)
con <- get_connection(dbtype)
skip_if(any(write_schema == "") || is.null(con))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-db-cohort_ddl.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ test_cohort_ddl <- function(con, write_schema) {
for (dbtype in dbToTest) {
test_that(glue::glue("{dbtype} - createCohortTables"), {
if (!(dbtype %in% ciTestDbs)) skip_on_ci()
if (dbtype != "duckdb") skip_on_cran()
con <- get_connection(dbtype)
write_schema <- get_write_schema(dbtype)
skip_if(any(write_schema == "") || is.null(con))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-db-compute.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ test_compute_query <- function(con, cdm_schema, write_schema) {
for (dbtype in dbToTest) {
test_that(glue::glue("{dbtype} - compute_query"), {
if (!(dbtype %in% ciTestDbs)) skip_on_ci()
if (dbtype != "duckdb") skip_on_cran()
con <- get_connection(dbtype)
cdm_schema <- get_cdm_schema(dbtype)
write_schema <- get_write_schema(dbtype)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-db-copy_cdm_to.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ test_copy_cdm_to <- function(con, write_schema) {
for (dbtype in dbToTest) {
test_that(glue::glue("{dbtype} - copy_cdm_to"), {
if (!(dbtype %in% ciTestDbs)) skip_on_ci()
if (dbtype != "duckdb") skip_on_cran()
con <- get_connection(dbtype)
prefix <- paste0("tbl", as.integer(Sys.time()), "_")
write_schema <- get_write_schema(dbtype, prefix = prefix)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-db-dateadd.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ test_date_functions <- function(con, write_schema) {
for (dbtype in dbToTest) {
test_that(glue::glue("{dbtype} - date functions"), {
if (!(dbtype %in% ciTestDbs)) skip_on_ci()
if (dbtype != "duckdb") skip_on_cran()
write_schema <- get_write_schema(dbtype)
skip_if(any(write_schema == ""))
con <- get_connection(dbtype)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-db-example-analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ for (dbtype in dbToTest) {
if (dbtype == "bigquery") next
require(dplyr)
test_that(glue::glue("{dbtype} - checking common usage"), {
if (dbtype != "duckdb") skip_on_cran()
con <- get_connection(dbtype)
cdm_schema <- get_cdm_schema(dbtype)
write_prefix <- paste0("test", as.integer(Sys.time()), "_")
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-db-generateCohortSet.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ test_cohort_generation <- function(con, cdm_schema, write_schema) {
for (dbtype in dbToTest) {
test_that(glue::glue("{dbtype} - generateCohortSet"), {
skip_if_not_installed("CirceR")
if (dbtype != "duckdb") skip_on_cran()
con <- get_connection(dbtype)
cdm_schema <- get_cdm_schema(dbtype)
write_schema <- get_write_schema(dbtype)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-db-generateConceptCohortSet.R
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ test_generate_concept_cohort_set <- function(con, cdm_schema, write_schema) {
for (dbtype in dbToTest) {
test_that(glue::glue("{dbtype} - generateConceptCohortSet"), {
if (!(dbtype %in% ciTestDbs)) skip_on_ci()
if (dbtype != "duckdb") skip_on_cran()
skip_if_not_installed("CirceR")
con <- get_connection(dbtype)
cdm_schema <- get_cdm_schema(dbtype)
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-db-newGeneratedCohortSet.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ test_new_generated_cohort_set <- function(con, cdm_schema, write_schema) {
# dbtype = "duckdb"
for (dbtype in dbToTest) {
test_that(glue::glue("{dbtype} - recordCohortAttrition"), {
if (!(dbtype %in% ciTestDbs)) skip_on_ci()
if (dbtype != "duckdb") skip_on_cran()
con <- get_connection(dbtype)
cdm_schema <- get_cdm_schema(dbtype)
write_schema <- get_write_schema(dbtype)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-db-recordCohortAttrition.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ test_record_cohort_attrition <- function(con, cdm_schema, write_schema) {
for (dbtype in dbToTest) {
test_that(glue::glue("{dbtype} - recordCohortAttrition"), {
if (!(dbtype %in% ciTestDbs)) skip_on_ci()
if (dbtype != "duckdb") skip_on_cran()
con <- get_connection(dbtype)
cdm_schema <- get_cdm_schema(dbtype)
write_schema <- get_write_schema(dbtype)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-db-summariseQuantile.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ test_summarise_quantile <- function(con,
for (dbtype in dbToTest) {
test_that(glue::glue("{dbtype} - summariseQuantile"), {
if (!(dbtype %in% ciTestDbs)) skip_on_ci()
if (dbtype != "duckdb") skip_on_cran()
con <- get_connection(dbtype)
prefix <- paste0("test", as.integer(Sys.time()), "_")
write_schema <- get_write_schema(dbtype, prefix = prefix)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-db-temp-tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ test_temp_tables <- function(dbtype) {
for (dbtype in dbToTest) {
test_that(glue::glue("{dbtype} - temp_tables"), {
if (!(dbtype %in% ciTestDbs)) skip_on_ci()
if (dbtype != "duckdb") skip_on_cran()
if (dbtype %in% c("sqlserver", "snowflake", "bigquery")) skip("failing test")
skip_if(get_write_schema(dbtype) == "")
con <- get_connection(dbtype)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-db-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ test_in_schema <- function(con, write_schema, cdm_schema) {
for (dbtype in dbToTest) {
test_that(glue::glue("{dbtype} - inSchema"), {
if (!(dbtype %in% ciTestDbs)) skip_on_ci()
if (dbtype != "duckdb") skip_on_cran()
con <- get_connection(dbtype)
cdm_schema <- get_cdm_schema(dbtype)

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-db-verify_write_schema.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
for (dbtype in dbToTest) {
test_that(glue::glue("{dbtype} - verify_write_access"), {
if (!(dbtype %in% ciTestDbs)) skip_on_ci()
if (dbtype != "duckdb") skip_on_cran()
write_schema <- get_write_schema(dbtype)
con <- get_connection(dbtype)
skip_if(any(write_schema == "") || is.null(con))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-db-write_schema_with_database.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# issue https://github.com/darwin-eu/CDMConnector/issues/12
test_that("write_schema can be in a separate database in snowflake", {
skip("manual test")
skip_on_cran()

con <- DBI::dbConnect(odbc::odbc(),
SERVER = Sys.getenv("SNOWFLAKE_SERVER"),
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-visR.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
test_that("visR attrition diagram works", {
skip_if_not_installed("visR")
skip_if_not_installed("CirceR")
skip_on_cran()

con <- DBI::dbConnect(duckdb::duckdb(), eunomia_dir())
cdm <- cdm_from_con(con, "main", "main")
Expand Down

0 comments on commit 269c3dd

Please sign in to comment.