Running ‘testthat.R’ [14s/12s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(DrugUtilisation)
  > 
  > dbToTest <- c(
  +   "duckdb"
  +   #,"sqlserver"
  +   #,"redshift"
  + )
  > 
  > availableConnections <- list(list(
  +   con = DBI::dbConnect(duckdb::duckdb(), ":memory:"),
  +   writeSchema = "main",
  +   mockPrefix = NULL
  + ))
  > 
  > # if (Sys.getenv("CDM5_SQL_SERVER_USER") != "") {
  > #   availableConnections <- availableConnections %>%
  > #     append(value = list(list(
  > #       con = DBI::dbConnect(
  > #         odbc::odbc(),
  > #         Driver   = "ODBC Driver 18 for SQL Server",
  > #         Server   = Sys.getenv("CDM5_SQL_SERVER_SERVER"),
  > #         Database = Sys.getenv("CDM5_SQL_SERVER_CDM_DATABASE"),
  > #         UID      = Sys.getenv("CDM5_SQL_SERVER_USER"),
  > #         PWD      = Sys.getenv("CDM5_SQL_SERVER_PASSWORD"),
  > #         TrustServerCertificate = "yes",
  > #         Port     = 1433
  > #       ),
  > #       writeSchema = Sys.getenv("CDM5_SQL_SERVER_OHDSI_SCHEMA"),
  > #       mockPrefix = "test_dus_"
  > #     )))
  > # }
  > 
  > # if (Sys.getenv("CDM5_REDSHIFT_DBNAME") != "") {
  > #   availableConnections <- availableConnections %>%
  > #     append(value = list(list(
  > #       con = DBI::dbConnect(
  > #         RPostgres::Redshift(), dbname = Sys.getenv("CDM5_REDSHIFT_DBNAME"),
  > #         port = Sys.getenv("CDM5_REDSHIFT_PORT"),
  > #         host = Sys.getenv("CDM5_REDSHIFT_HOST"),
  > #         user = Sys.getenv("CDM5_REDSHIFT_USER"),
  > #         password = Sys.getenv("CDM5_REDSHIFT_PASSWORD")
  > #       ),
  > #       writeSchema = Sys.getenv("CDM5_REDSHIFT_SCRATCH_SCHEMA"),
  > #       mockPrefix = "test_dus_"
  > #     )))
  > # }
  > 
  > for (k in seq_along(availableConnections)) {
  +   # connection details
  +   connectionDetails <- availableConnections[[k]]
  +   # test code in that dbms
  +   test_check("DrugUtilisation")
  + }
  [ FAIL 11 | WARN 0 | SKIP 14 | PASS 0 ]
  
  ══ Skipped tests (14) ══════════════════════════════════════════════════════════
  • On CRAN (14): 'test-dailyDose.R:2:3', 'test-drugUse.R:3:3',
    'test-drugUse.R:219:3', 'test-drugUse.R:443:3', 'test-drugUse.R:601:3',
    'test-drugUse.R:852:3', 'test-drugUse.R:901:3', 'test-drugUse.R:941:3',
    'test-generateDrugUtilisationCohortSet.R:51:3',
    'test-generateDrugUtilisationCohortSet.R:188:3',
    'test-generateDrugUtilisationCohortSet.R:235:3', 'test-indication.R:165:3',
    'test-indication.R:316:3', 'test-indication.R:436:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-drugUse.R:975:3'): check all estimates ─────────────────────────
  Error in `CDMConnector::cdm_from_con(con, cdm_schema = dbSchema, write_schema = dbSchema, 
      cohort_tables = names(cohorts))`: Assertion on 'cdm_schema' failed: Must be of type 'character', not 'Id'.
  Backtrace:
      ▆
   1. └─DrugUtilisation::mockDrugUtilisation(...) at test-drugUse.R:975:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─checkmate::assert_character(cdm_schema, min.len = 1, max.len = 3)
   4.       └─checkmate::makeAssertion(x, res, .var.name, add)
   5.         └─checkmate:::mstop(...)
  ── Error ('test-drugUse.R:1027:3'): check all variables ────────────────────────
  Error in `CDMConnector::cdm_from_con(con, cdm_schema = dbSchema, write_schema = dbSchema, 
      cohort_tables = names(cohorts))`: Assertion on 'cdm_schema' failed: Must be of type 'character', not 'Id'.
  Backtrace:
      ▆
   1. └─DrugUtilisation::mockDrugUtilisation(connectionDetails) at test-drugUse.R:1027:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─checkmate::assert_character(cdm_schema, min.len = 1, max.len = 3)
   4.       └─checkmate::makeAssertion(x, res, .var.name, add)
   5.         └─checkmate:::mstop(...)
  ── Error ('test-generateConceptCohortSet.R:2:3'): test inputs ──────────────────
  Error in `CDMConnector::cdm_from_con(con, cdm_schema = dbSchema, write_schema = dbSchema, 
      cohort_tables = names(cohorts))`: Assertion on 'cdm_schema' failed: Must be of type 'character', not 'Id'.
  Backtrace:
      ▆
   1. └─DrugUtilisation::mockDrugUtilisation(connectionDetails) at test-generateConceptCohortSet.R:2:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─checkmate::assert_character(cdm_schema, min.len = 1, max.len = 3)
   4.       └─checkmate::makeAssertion(x, res, .var.name, add)
   5.         └─checkmate:::mstop(...)
  ── Error ('test-generateDrugUtilisationCohortSet.R:2:3'): test inputs ──────────
  Error in `CDMConnector::cdm_from_con(con, cdm_schema = dbSchema, write_schema = dbSchema, 
      cohort_tables = names(cohorts))`: Assertion on 'cdm_schema' failed: Must be of type 'character', not 'Id'.
  Backtrace:
      ▆
   1. └─DrugUtilisation::mockDrugUtilisation(connectionDetails) at test-generateDrugUtilisationCohortSet.R:2:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─checkmate::assert_character(cdm_schema, min.len = 1, max.len = 3)
   4.       └─checkmate::makeAssertion(x, res, .var.name, add)
   5.         └─checkmate:::mstop(...)
  ── Error ('test-indication.R:56:3'): test case single indication ───────────────
  Error in `CDMConnector::cdm_from_con(con, cdm_schema = dbSchema, write_schema = dbSchema, 
      cohort_tables = names(cohorts))`: Assertion on 'cdm_schema' failed: Must be of type 'character', not 'Id'.
  Backtrace:
      ▆
   1. └─DrugUtilisation::mockDrugUtilisation(...) at test-indication.R:56:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─checkmate::assert_character(cdm_schema, min.len = 1, max.len = 3)
   4.       └─checkmate::makeAssertion(x, res, .var.name, add)
   5.         └─checkmate:::mstop(...)
  ── Error ('test-indication.R:536:3'): summariseIndication ──────────────────────
  Error in `CDMConnector::cdm_from_con(con, cdm_schema = dbSchema, write_schema = dbSchema, 
      cohort_tables = names(cohorts))`: Assertion on 'cdm_schema' failed: Must be of type 'character', not 'Id'.
  Backtrace:
      ▆
   1. └─DrugUtilisation::mockDrugUtilisation(...) at test-indication.R:536:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─checkmate::assert_character(cdm_schema, min.len = 1, max.len = 3)
   4.       └─checkmate::makeAssertion(x, res, .var.name, add)
   5.         └─checkmate:::mstop(...)
  ── Error ('test-largeScaleCharacteristics.R:63:3'): basic functionality large scale characteristics ──
  Error in `CDMConnector::cdm_from_con(con, cdm_schema = dbSchema, write_schema = dbSchema, 
      cohort_tables = names(cohorts))`: Assertion on 'cdm_schema' failed: Must be of type 'character', not 'Id'.
  Backtrace:
      ▆
   1. └─DrugUtilisation::mockDrugUtilisation(...) at test-largeScaleCharacteristics.R:63:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─checkmate::assert_character(cdm_schema, min.len = 1, max.len = 3)
   4.       └─checkmate::makeAssertion(x, res, .var.name, add)
   5.         └─checkmate:::mstop(...)
  ── Error ('test-largeScaleCharacteristics.R:165:3'): basic functionality summariseCodelist ──
  Error in `CDMConnector::cdm_from_con(con, cdm_schema = dbSchema, write_schema = dbSchema, 
      cohort_tables = names(cohorts))`: Assertion on 'cdm_schema' failed: Must be of type 'character', not 'Id'.
  Backtrace:
      ▆
   1. └─DrugUtilisation::mockDrugUtilisation(connectionDetails) at test-largeScaleCharacteristics.R:165:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─checkmate::assert_character(cdm_schema, min.len = 1, max.len = 3)
   4.       └─checkmate::makeAssertion(x, res, .var.name, add)
   5.         └─checkmate:::mstop(...)
  ── Error ('test-patterns.R:2:3'): check mock patterns ──────────────────────────
  Error in `CDMConnector::cdm_from_con(con, cdm_schema = dbSchema, write_schema = dbSchema, 
      cohort_tables = names(cohorts))`: Assertion on 'cdm_schema' failed: Must be of type 'character', not 'Id'.
  Backtrace:
      ▆
   1. └─DrugUtilisation::mockDrugUtilisation(connectionDetails) at test-patterns.R:2:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─checkmate::assert_character(cdm_schema, min.len = 1, max.len = 3)
   4.       └─checkmate::makeAssertion(x, res, .var.name, add)
   5.         └─checkmate:::mstop(...)
  ── Error ('test-patterns.R:46:2'): create patterns, correct output ─────────────
  Error in `CDMConnector::cdm_from_con(con, cdm_schema = dbSchema, write_schema = dbSchema, 
      cohort_tables = names(cohorts))`: Assertion on 'cdm_schema' failed: Must be of type 'character', not 'Id'.
  Backtrace:
      ▆
   1. └─DrugUtilisation::mockDrugUtilisation(...) at test-patterns.R:46:1
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─checkmate::assert_character(cdm_schema, min.len = 1, max.len = 3)
   4.       └─checkmate::makeAssertion(x, res, .var.name, add)
   5.         └─checkmate:::mstop(...)
  ── Error ('test-readConceptList.R:2:3'): test inputs ───────────────────────────
  Error in `CDMConnector::cdm_from_con(con, cdm_schema = dbSchema, write_schema = dbSchema, 
      cohort_tables = names(cohorts))`: Assertion on 'cdm_schema' failed: Must be of type 'character', not 'Id'.
  Backtrace:
      ▆
   1. └─DrugUtilisation::mockDrugUtilisation(connectionDetails) at test-readConceptList.R:2:2
   2.   └─CDMConnector::cdm_from_con(...)
   3.     └─checkmate::assert_character(cdm_schema, min.len = 1, max.len = 3)
   4.       └─checkmate::makeAssertion(x, res, .var.name, add)
   5.         └─checkmate:::mstop(...)
  
  [ FAIL 11 | WARN 0 | SKIP 14 | PASS 0 ]
  Error: Test failures
  Execution halted
  Warning messages:
  1: Connection is garbage-collected, use dbDisconnect() to avoid this. 
  2: Database is garbage-collected, use dbDisconnect(con, shutdown=TRUE) or duckdb::duckdb_shutdown(drv) to avoid this.