Running ‘testthat.R’ [4s/5s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(CodelistGenerator)
  > 
  > test_check("CodelistGenerator")
  [ FAIL 15 | WARN 0 | SKIP 5 | PASS 3 ]
  
  ══ Skipped tests (5) ═══════════════════════════════════════════════════════════
  • On CRAN (2): 'test-summariseCodeUse.R:2:1', 'test-summariseCodeUse.R:290:3'
  • Sys.getenv("CDM5_REDSHIFT_DBNAME") == "" is TRUE (2):
    'test-codesFrom.R:100:3', 'test-summariseCodeUse.R:498:3'
  • Sys.getenv("darwinDbDatabaseServer") == "" is TRUE (1):
    'test-synthea_sql_server.R:2:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-codesFrom.R:6:5'): test inputs - mock ──────────────────────────
  Error in `(function (cond) 
  .Internal(C_tryCatchHelper(addr, 1L, cond)))(structure(list(message = "there is no package called 'duckdb'", 
      call = loadNamespace(x), package = "duckdb", lib.loc = NULL), class = c("packageNotFoundError", 
  "error", "condition")))`: error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': there is no package called 'duckdb'
  Backtrace:
      ▆
   1. ├─CodelistGenerator::mockVocabRef(backends[[i]]) at test-codesFrom.R:6:5
   2. │ └─DBI::dbConnect(duckdb::duckdb(), ":memory:")
   3. ├─base::loadNamespace(x)
   4. │ ├─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5. │ │ └─base (local) withOneRestart(expr, restarts[[1L]])
   6. │ │   └─base (local) doWithOneRestart(return(expr), restart)
   7. │ └─base::stop(cond)
   8. └─base (local) `<fn>`(`<pckgNtFE>`)
  ── Error ('test-compareCodelists.R:6:5'): comparing two codelists ──────────────
  Error in `(function (cond) 
  .Internal(C_tryCatchHelper(addr, 1L, cond)))(structure(list(message = "there is no package called 'duckdb'", 
      call = loadNamespace(x), package = "duckdb", lib.loc = NULL), class = c("packageNotFoundError", 
  "error", "condition")))`: error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': there is no package called 'duckdb'
  Backtrace:
      ▆
   1. ├─CodelistGenerator::mockVocabRef(backends[[i]]) at test-compareCodelists.R:6:5
   2. │ └─DBI::dbConnect(duckdb::duckdb(), ":memory:")
   3. ├─base::loadNamespace(x)
   4. │ ├─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5. │ │ └─base (local) withOneRestart(expr, restarts[[1L]])
   6. │ │   └─base (local) doWithOneRestart(return(expr), restart)
   7. │ └─base::stop(cond)
   8. └─base (local) `<fn>`(`<pckgNtFE>`)
  ── Error ('test-compareCodelists.R:77:5'): comparing two codelists- same codes found different ways ──
  Error in `(function (cond) 
  .Internal(C_tryCatchHelper(addr, 1L, cond)))(structure(list(message = "there is no package called 'duckdb'", 
      call = loadNamespace(x), package = "duckdb", lib.loc = NULL), class = c("packageNotFoundError", 
  "error", "condition")))`: error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': there is no package called 'duckdb'
  Backtrace:
      ▆
   1. ├─CodelistGenerator::mockVocabRef(backends[[i]]) at test-compareCodelists.R:77:5
   2. │ └─DBI::dbConnect(duckdb::duckdb(), ":memory:")
   3. ├─base::loadNamespace(x)
   4. │ ├─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5. │ │ └─base (local) withOneRestart(expr, restarts[[1L]])
   6. │ │   └─base (local) doWithOneRestart(return(expr), restart)
   7. │ └─base::stop(cond)
   8. └─base (local) `<fn>`(`<pckgNtFE>`)
  ── Error ('test-drugCodes.R:5:3'): getATCCodes working ─────────────────────────
  Error in `(function (cond) 
  .Internal(C_tryCatchHelper(addr, 1L, cond)))(structure(list(message = "there is no package called 'duckdb'", 
      call = loadNamespace(x), package = "duckdb", lib.loc = NULL), class = c("packageNotFoundError", 
  "error", "condition")))`: error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': there is no package called 'duckdb'
  Backtrace:
      ▆
   1. ├─CodelistGenerator::mockVocabRef(backend = backends[i]) at test-drugCodes.R:5:3
   2. │ └─DBI::dbConnect(duckdb::duckdb(), ":memory:")
   3. ├─base::loadNamespace(x)
   4. │ ├─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5. │ │ └─base (local) withOneRestart(expr, restarts[[1L]])
   6. │ │   └─base (local) doWithOneRestart(return(expr), restart)
   7. │ └─base::stop(cond)
   8. └─base (local) `<fn>`(`<pckgNtFE>`)
  ── Error ('test-drugCodes.R:33:5'): getATCCodes expected errors ────────────────
  Error in `(function (cond) 
  .Internal(C_tryCatchHelper(addr, 1L, cond)))(structure(list(message = "there is no package called 'duckdb'", 
      call = loadNamespace(x), package = "duckdb", lib.loc = NULL), class = c("packageNotFoundError", 
  "error", "condition")))`: error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': there is no package called 'duckdb'
  Backtrace:
      ▆
   1. ├─CodelistGenerator::mockVocabRef(backend = backends[i]) at test-drugCodes.R:33:5
   2. │ └─DBI::dbConnect(duckdb::duckdb(), ":memory:")
   3. ├─base::loadNamespace(x)
   4. │ ├─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5. │ │ └─base (local) withOneRestart(expr, restarts[[1L]])
   6. │ │   └─base (local) doWithOneRestart(return(expr), restart)
   7. │ └─base::stop(cond)
   8. └─base (local) `<fn>`(`<pckgNtFE>`)
  ── Error ('test-drugCodes.R:49:5'): getDrugIngredientCodes working ─────────────
  Error in `(function (cond) 
  .Internal(C_tryCatchHelper(addr, 1L, cond)))(structure(list(message = "there is no package called 'duckdb'", 
      call = loadNamespace(x), package = "duckdb", lib.loc = NULL), class = c("packageNotFoundError", 
  "error", "condition")))`: error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': there is no package called 'duckdb'
  Backtrace:
      ▆
   1. ├─CodelistGenerator::mockVocabRef(backend = backends[i]) at test-drugCodes.R:49:5
   2. │ └─DBI::dbConnect(duckdb::duckdb(), ":memory:")
   3. ├─base::loadNamespace(x)
   4. │ ├─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5. │ │ └─base (local) withOneRestart(expr, restarts[[1L]])
   6. │ │   └─base (local) doWithOneRestart(return(expr), restart)
   7. │ └─base::stop(cond)
   8. └─base (local) `<fn>`(`<pckgNtFE>`)
  ── Error ('test-drugCodes.R:84:5'): getDrugIngredientCodes expected errors ─────
  Error in `(function (cond) 
  .Internal(C_tryCatchHelper(addr, 1L, cond)))(structure(list(message = "there is no package called 'duckdb'", 
      call = loadNamespace(x), package = "duckdb", lib.loc = NULL), class = c("packageNotFoundError", 
  "error", "condition")))`: error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': there is no package called 'duckdb'
  Backtrace:
      ▆
   1. ├─CodelistGenerator::mockVocabRef(backend = backends[i]) at test-drugCodes.R:84:5
   2. │ └─DBI::dbConnect(duckdb::duckdb(), ":memory:")
   3. ├─base::loadNamespace(x)
   4. │ ├─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5. │ │ └─base (local) withOneRestart(expr, restarts[[1L]])
   6. │ │   └─base (local) doWithOneRestart(return(expr), restart)
   7. │ └─base::stop(cond)
   8. └─base (local) `<fn>`(`<pckgNtFE>`)
  ── Error ('test-getCandidateCodes.R:6:5'): tests with mock db ──────────────────
  Error in `(function (cond) 
  .Internal(C_tryCatchHelper(addr, 1L, cond)))(structure(list(message = "there is no package called 'duckdb'", 
      call = loadNamespace(x), package = "duckdb", lib.loc = NULL), class = c("packageNotFoundError", 
  "error", "condition")))`: error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': there is no package called 'duckdb'
  Backtrace:
      ▆
   1. ├─CodelistGenerator::mockVocabRef(backends[[i]]) at test-getCandidateCodes.R:6:5
   2. │ └─DBI::dbConnect(duckdb::duckdb(), ":memory:")
   3. ├─base::loadNamespace(x)
   4. │ ├─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5. │ │ └─base (local) withOneRestart(expr, restarts[[1L]])
   6. │ │   └─base (local) doWithOneRestart(return(expr), restart)
   7. │ └─base::stop(cond)
   8. └─base (local) `<fn>`(`<pckgNtFE>`)
  ── Error ('test-getCandidateCodes.R:263:5'): tests with mock db - multiple domains ──
  Error in `(function (cond) 
  .Internal(C_tryCatchHelper(addr, 1L, cond)))(structure(list(message = "there is no package called 'duckdb'", 
      call = loadNamespace(x), package = "duckdb", lib.loc = NULL), class = c("packageNotFoundError", 
  "error", "condition")))`: error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': there is no package called 'duckdb'
  Backtrace:
      ▆
   1. ├─CodelistGenerator::mockVocabRef(backends[[i]]) at test-getCandidateCodes.R:263:5
   2. │ └─DBI::dbConnect(duckdb::duckdb(), ":memory:")
   3. ├─base::loadNamespace(x)
   4. │ ├─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5. │ │ └─base (local) withOneRestart(expr, restarts[[1L]])
   6. │ │   └─base (local) doWithOneRestart(return(expr), restart)
   7. │ └─base::stop(cond)
   8. └─base (local) `<fn>`(`<pckgNtFE>`)
  ── Error ('test-getICD10StandardCodes.R:4:5'): db without icd10 codes loaded ───
  Error in `(function (cond) 
  .Internal(C_tryCatchHelper(addr, 1L, cond)))(structure(list(message = "there is no package called 'duckdb'", 
      call = loadNamespace(x), package = "duckdb", lib.loc = NULL), class = c("packageNotFoundError", 
  "error", "condition")))`: error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': there is no package called 'duckdb'
  Backtrace:
      ▆
   1. ├─CodelistGenerator::mockVocabRef(backend = backends[i]) at test-getICD10StandardCodes.R:4:5
   2. │ └─DBI::dbConnect(duckdb::duckdb(), ":memory:")
   3. ├─base::loadNamespace(x)
   4. │ ├─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5. │ │ └─base (local) withOneRestart(expr, restarts[[1L]])
   6. │ │   └─base (local) doWithOneRestart(return(expr), restart)
   7. │ └─base::stop(cond)
   8. └─base (local) `<fn>`(`<pckgNtFE>`)
  ── Error ('test-getICD10StandardCodes.R:59:3'): db without icd10 codes loaded ──
  Error in `(function (cond) 
  .Internal(C_tryCatchHelper(addr, 1L, cond)))(structure(list(message = "there is no package called 'duckdb'", 
      call = loadNamespace(x), package = "duckdb", lib.loc = NULL), class = c("packageNotFoundError", 
  "error", "condition")))`: error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': there is no package called 'duckdb'
  Backtrace:
      ▆
   1. ├─CodelistGenerator::mockVocabRef() at test-getICD10StandardCodes.R:59:3
   2. │ └─DBI::dbConnect(duckdb::duckdb(), ":memory:")
   3. ├─base::loadNamespace(x)
   4. │ ├─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5. │ │ └─base (local) withOneRestart(expr, restarts[[1L]])
   6. │ │   └─base (local) doWithOneRestart(return(expr), restart)
   7. │ └─base::stop(cond)
   8. └─base (local) `<fn>`(`<pckgNtFE>`)
  ── Error ('test-getICD10StandardCodes.R:68:3'): expected errors ────────────────
  Error in `(function (cond) 
  .Internal(C_tryCatchHelper(addr, 1L, cond)))(structure(list(message = "there is no package called 'duckdb'", 
      call = loadNamespace(x), package = "duckdb", lib.loc = NULL), class = c("packageNotFoundError", 
  "error", "condition")))`: error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': there is no package called 'duckdb'
  Backtrace:
      ▆
   1. ├─CodelistGenerator::mockVocabRef() at test-getICD10StandardCodes.R:68:3
   2. │ └─DBI::dbConnect(duckdb::duckdb(), ":memory:")
   3. ├─base::loadNamespace(x)
   4. │ ├─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5. │ │ └─base (local) withOneRestart(expr, restarts[[1L]])
   6. │ │   └─base (local) doWithOneRestart(return(expr), restart)
   7. │ └─base::stop(cond)
   8. └─base (local) `<fn>`(`<pckgNtFE>`)
  ── Error ('test-getMappings.R:6:5'): tests with mock ───────────────────────────
  Error in `(function (cond) 
  .Internal(C_tryCatchHelper(addr, 1L, cond)))(structure(list(message = "there is no package called 'duckdb'", 
      call = loadNamespace(x), package = "duckdb", lib.loc = NULL), class = c("packageNotFoundError", 
  "error", "condition")))`: error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': there is no package called 'duckdb'
  Backtrace:
      ▆
   1. ├─CodelistGenerator::mockVocabRef(backends[[i]]) at test-getMappings.R:6:5
   2. │ └─DBI::dbConnect(duckdb::duckdb(), ":memory:")
   3. ├─base::loadNamespace(x)
   4. │ ├─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5. │ │ └─base (local) withOneRestart(expr, restarts[[1L]])
   6. │ │   └─base (local) doWithOneRestart(return(expr), restart)
   7. │ └─base::stop(cond)
   8. └─base (local) `<fn>`(`<pckgNtFE>`)
  ── Error ('test-mockVocabRef.R:2:3'): mock vocab db ────────────────────────────
  Error in `(function (cond) 
  .Internal(C_tryCatchHelper(addr, 1L, cond)))(structure(list(message = "there is no package called 'duckdb'", 
      call = loadNamespace(x), package = "duckdb", lib.loc = NULL), class = c("packageNotFoundError", 
  "error", "condition")))`: error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': there is no package called 'duckdb'
  Backtrace:
      ▆
   1. ├─CodelistGenerator::mockVocabRef("database") at test-mockVocabRef.R:2:3
   2. │ └─DBI::dbConnect(duckdb::duckdb(), ":memory:")
   3. ├─base::loadNamespace(x)
   4. │ ├─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5. │ │ └─base (local) withOneRestart(expr, restarts[[1L]])
   6. │ │   └─base (local) doWithOneRestart(return(expr), restart)
   7. │ └─base::stop(cond)
   8. └─base (local) `<fn>`(`<pckgNtFE>`)
  ── Error ('test-vocabUtilities.R:6:5'): tests with mock db ─────────────────────
  Error in `(function (cond) 
  .Internal(C_tryCatchHelper(addr, 1L, cond)))(structure(list(message = "there is no package called 'duckdb'", 
      call = loadNamespace(x), package = "duckdb", lib.loc = NULL), class = c("packageNotFoundError", 
  "error", "condition")))`: error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': there is no package called 'duckdb'
  Backtrace:
      ▆
   1. ├─CodelistGenerator::mockVocabRef(backends[[i]]) at test-vocabUtilities.R:6:5
   2. │ └─DBI::dbConnect(duckdb::duckdb(), ":memory:")
   3. ├─base::loadNamespace(x)
   4. │ ├─base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   5. │ │ └─base (local) withOneRestart(expr, restarts[[1L]])
   6. │ │   └─base (local) doWithOneRestart(return(expr), restart)
   7. │ └─base::stop(cond)
   8. └─base (local) `<fn>`(`<pckgNtFE>`)
  
  [ FAIL 15 | WARN 0 | SKIP 5 | PASS 3 ]
  Error: Test failures
  Execution halted