Running ‘testthat.R’ [28s/26s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/tests.html
  > # * https://testthat.r-lib.org/reference/test_package.html#special-files
  > 
  > library(testthat)
  > library(DrugUtilisation)
  > 
  > test_check("DrugUtilisation")
  Starting 2 test processes
  [ FAIL 8 | WARN 0 | SKIP 18 | PASS 0 ]
  
  ══ Skipped tests (18) ══════════════════════════════════════════════════════════
  • On CRAN (18): 'test-dailyDose.R:2:3',
    'test-generateDrugUtilisationCohortSet.R:48:3',
    'test-generateDrugUtilisationCohortSet.R:147:3',
    'test-generateDrugUtilisationCohortSet.R:203:3',
    'test-generateDrugUtilisationCohortSet.R:253:3',
    'test-generateDrugUtilisationCohortSet.R:351:3', 'test-drugUse.R:3:3',
    'test-drugUse.R:41:3', 'test-drugUse.R:246:3', 'test-drugUse.R:432:3',
    'test-drugUse.R:559:3', 'test-drugUse.R:810:3', 'test-drugUse.R:859:3',
    'test-drugUse.R:899:3', 'test-indication.R:3:3', 'test-indication.R:182:3',
    'test-indication.R:333:3', 'test-indication.R:443:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-generateConceptCohortSet.R:2:3'): test inputs ──────────────────
  <vctrs_error_cast/vctrs_error_incompatible_type/vctrs_error_incompatible/vctrs_error/rlang_error/error/condition>
  Error in `as.character(cohort_ref[[2]]$x)`: Can't convert `x` <dbplyr_table_ident> to <character>.
  Backtrace:
       ▆
    1. ├─DrugUtilisation::mockDrugUtilisation(connectionDetails) at test-generateConceptCohortSet.R:2:2
    2. │ └─CDMConnector::cdm_from_con(...)
    3. │   └─CDMConnector::new_generated_cohort_set(...)
    4. │     ├─... %>% stringr::str_remove_all("[^A-Za-z0-9_]")
    5. │     ├─base::rev(...)
    6. │     ├─stringr::str_split(as.character(cohort_ref[[2]]$x), "\\.")
    7. │     │ └─stringr:::check_lengths(string, pattern)
    8. │     │   └─vctrs::vec_size_common(...)
    9. │     ├─base::as.character(cohort_ref[[2]]$x)
   10. │     └─vctrs:::as.character.vctrs_vctr(cohort_ref[[2]]$x)
   11. │       └─vctrs::vec_cast(x, character())
   12. ├─stringr::str_remove_all(., "[^A-Za-z0-9_]")
   13. │ └─stringr::str_replace_all(string, pattern, "")
   14. │   └─stringr:::check_lengths(string, pattern, replacement)
   15. │     └─vctrs::vec_size_common(...)
   16. └─vctrs (local) `<fn>`()
   17.   └─vctrs::vec_default_cast(...)
   18.     ├─base::withRestarts(...)
   19.     │ └─base (local) withOneRestart(expr, restarts[[1L]])
   20.     │   └─base (local) doWithOneRestart(return(expr), restart)
   21.     └─vctrs::stop_incompatible_cast(...)
   22.       └─vctrs::stop_incompatible_type(...)
   23.         └─vctrs:::stop_incompatible(...)
   24.           └─vctrs:::stop_vctrs(...)
   25.             └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call)
  ── Error ('test-generateDrugUtilisationCohortSet.R:2:3'): test inputs ──────────
  <vctrs_error_cast/vctrs_error_incompatible_type/vctrs_error_incompatible/vctrs_error/rlang_error/error/condition>
  Error in `as.character(cohort_ref[[2]]$x)`: Can't convert `x` <dbplyr_table_ident> to <character>.
  Backtrace:
       ▆
    1. ├─DrugUtilisation::mockDrugUtilisation(connectionDetails) at test-generateDrugUtilisationCohortSet.R:2:2
    2. │ └─CDMConnector::cdm_from_con(...)
    3. │   └─CDMConnector::new_generated_cohort_set(...)
    4. │     ├─... %>% stringr::str_remove_all("[^A-Za-z0-9_]")
    5. │     ├─base::rev(...)
    6. │     ├─stringr::str_split(as.character(cohort_ref[[2]]$x), "\\.")
    7. │     │ └─stringr:::check_lengths(string, pattern)
    8. │     │   └─vctrs::vec_size_common(...)
    9. │     ├─base::as.character(cohort_ref[[2]]$x)
   10. │     └─vctrs:::as.character.vctrs_vctr(cohort_ref[[2]]$x)
   11. │       └─vctrs::vec_cast(x, character())
   12. ├─stringr::str_remove_all(., "[^A-Za-z0-9_]")
   13. │ └─stringr::str_replace_all(string, pattern, "")
   14. │   └─stringr:::check_lengths(string, pattern, replacement)
   15. │     └─vctrs::vec_size_common(...)
   16. └─vctrs (local) `<fn>`()
   17.   └─vctrs::vec_default_cast(...)
   18.     ├─base::withRestarts(...)
   19.     │ └─base (local) withOneRestart(expr, restarts[[1L]])
   20.     │   └─base (local) doWithOneRestart(return(expr), restart)
   21.     └─vctrs::stop_incompatible_cast(...)
   22.       └─vctrs::stop_incompatible_type(...)
   23.         └─vctrs:::stop_incompatible(...)
   24.           └─vctrs:::stop_vctrs(...)
   25.             └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call)
  ── Error ('test-drugUse.R:934:3'): check all estimates ─────────────────────────
  <vctrs_error_cast/vctrs_error_incompatible_type/vctrs_error_incompatible/vctrs_error/rlang_error/error/condition>
  Error in `as.character(cohort_ref[[2]]$x)`: Can't convert `x` <dbplyr_table_ident> to <character>.
  Backtrace:
       ▆
    1. ├─DrugUtilisation::mockDrugUtilisation(...) at test-drugUse.R:934:2
    2. │ └─CDMConnector::cdm_from_con(...)
    3. │   └─CDMConnector::new_generated_cohort_set(...)
    4. │     ├─... %>% stringr::str_remove_all("[^A-Za-z0-9_]")
    5. │     ├─base::rev(...)
    6. │     ├─stringr::str_split(as.character(cohort_ref[[2]]$x), "\\.")
    7. │     │ └─stringr:::check_lengths(string, pattern)
    8. │     │   └─vctrs::vec_size_common(...)
    9. │     ├─base::as.character(cohort_ref[[2]]$x)
   10. │     └─vctrs:::as.character.vctrs_vctr(cohort_ref[[2]]$x)
   11. │       └─vctrs::vec_cast(x, character())
   12. ├─stringr::str_remove_all(., "[^A-Za-z0-9_]")
   13. │ └─stringr::str_replace_all(string, pattern, "")
   14. │   └─stringr:::check_lengths(string, pattern, replacement)
   15. │     └─vctrs::vec_size_common(...)
   16. └─vctrs (local) `<fn>`()
   17.   └─vctrs::vec_default_cast(...)
   18.     ├─base::withRestarts(...)
   19.     │ └─base (local) withOneRestart(expr, restarts[[1L]])
   20.     │   └─base (local) doWithOneRestart(return(expr), restart)
   21.     └─vctrs::stop_incompatible_cast(...)
   22.       └─vctrs::stop_incompatible_type(...)
   23.         └─vctrs:::stop_incompatible(...)
   24.           └─vctrs:::stop_vctrs(...)
   25.             └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call)
  ── Error ('test-drugUse.R:985:3'): check all variables ─────────────────────────
  <vctrs_error_cast/vctrs_error_incompatible_type/vctrs_error_incompatible/vctrs_error/rlang_error/error/condition>
  Error in `as.character(cohort_ref[[2]]$x)`: Can't convert `x` <dbplyr_table_ident> to <character>.
  Backtrace:
       ▆
    1. ├─DrugUtilisation::mockDrugUtilisation(...) at test-drugUse.R:985:2
    2. │ └─CDMConnector::cdm_from_con(...)
    3. │   └─CDMConnector::new_generated_cohort_set(...)
    4. │     ├─... %>% stringr::str_remove_all("[^A-Za-z0-9_]")
    5. │     ├─base::rev(...)
    6. │     ├─stringr::str_split(as.character(cohort_ref[[2]]$x), "\\.")
    7. │     │ └─stringr:::check_lengths(string, pattern)
    8. │     │   └─vctrs::vec_size_common(...)
    9. │     ├─base::as.character(cohort_ref[[2]]$x)
   10. │     └─vctrs:::as.character.vctrs_vctr(cohort_ref[[2]]$x)
   11. │       └─vctrs::vec_cast(x, character())
   12. ├─stringr::str_remove_all(., "[^A-Za-z0-9_]")
   13. │ └─stringr::str_replace_all(string, pattern, "")
   14. │   └─stringr:::check_lengths(string, pattern, replacement)
   15. │     └─vctrs::vec_size_common(...)
   16. └─vctrs (local) `<fn>`()
   17.   └─vctrs::vec_default_cast(...)
   18.     ├─base::withRestarts(...)
   19.     │ └─base (local) withOneRestart(expr, restarts[[1L]])
   20.     │   └─base (local) doWithOneRestart(return(expr), restart)
   21.     └─vctrs::stop_incompatible_cast(...)
   22.       └─vctrs::stop_incompatible_type(...)
   23.         └─vctrs:::stop_incompatible(...)
   24.           └─vctrs:::stop_vctrs(...)
   25.             └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call)
  ── Error ('test-indication.R:531:3'): summariseIndication ──────────────────────
  <vctrs_error_cast/vctrs_error_incompatible_type/vctrs_error_incompatible/vctrs_error/rlang_error/error/condition>
  Error in `as.character(cohort_ref[[2]]$x)`: Can't convert `x` <dbplyr_table_ident> to <character>.
  Backtrace:
       ▆
    1. ├─DrugUtilisation::mockDrugUtilisation(...) at test-indication.R:531:2
    2. │ └─CDMConnector::cdm_from_con(...)
    3. │   └─CDMConnector::new_generated_cohort_set(...)
    4. │     ├─... %>% stringr::str_remove_all("[^A-Za-z0-9_]")
    5. │     ├─base::rev(...)
    6. │     ├─stringr::str_split(as.character(cohort_ref[[2]]$x), "\\.")
    7. │     │ └─stringr:::check_lengths(string, pattern)
    8. │     │   └─vctrs::vec_size_common(...)
    9. │     ├─base::as.character(cohort_ref[[2]]$x)
   10. │     └─vctrs:::as.character.vctrs_vctr(cohort_ref[[2]]$x)
   11. │       └─vctrs::vec_cast(x, character())
   12. ├─stringr::str_remove_all(., "[^A-Za-z0-9_]")
   13. │ └─stringr::str_replace_all(string, pattern, "")
   14. │   └─stringr:::check_lengths(string, pattern, replacement)
   15. │     └─vctrs::vec_size_common(...)
   16. └─vctrs (local) `<fn>`()
   17.   └─vctrs::vec_default_cast(...)
   18.     ├─base::withRestarts(...)
   19.     │ └─base (local) withOneRestart(expr, restarts[[1L]])
   20.     │   └─base (local) doWithOneRestart(return(expr), restart)
   21.     └─vctrs::stop_incompatible_cast(...)
   22.       └─vctrs::stop_incompatible_type(...)
   23.         └─vctrs:::stop_incompatible(...)
   24.           └─vctrs:::stop_vctrs(...)
   25.             └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call)
  ── Error ('test-largeScaleCharacteristics.R:3:3'): basic functionality summariseCodelist ──
  <vctrs_error_cast/vctrs_error_incompatible_type/vctrs_error_incompatible/vctrs_error/rlang_error/error/condition>
  Error in `as.character(cohort_ref[[2]]$x)`: Can't convert `x` <dbplyr_table_ident> to <character>.
  Backtrace:
       ▆
    1. ├─DrugUtilisation::mockDrugUtilisation(connectionDetails) at test-largeScaleCharacteristics.R:3:2
    2. │ └─CDMConnector::cdm_from_con(...)
    3. │   └─CDMConnector::new_generated_cohort_set(...)
    4. │     ├─... %>% stringr::str_remove_all("[^A-Za-z0-9_]")
    5. │     ├─base::rev(...)
    6. │     ├─stringr::str_split(as.character(cohort_ref[[2]]$x), "\\.")
    7. │     │ └─stringr:::check_lengths(string, pattern)
    8. │     │   └─vctrs::vec_size_common(...)
    9. │     ├─base::as.character(cohort_ref[[2]]$x)
   10. │     └─vctrs:::as.character.vctrs_vctr(cohort_ref[[2]]$x)
   11. │       └─vctrs::vec_cast(x, character())
   12. ├─stringr::str_remove_all(., "[^A-Za-z0-9_]")
   13. │ └─stringr::str_replace_all(string, pattern, "")
   14. │   └─stringr:::check_lengths(string, pattern, replacement)
   15. │     └─vctrs::vec_size_common(...)
   16. └─vctrs (local) `<fn>`()
   17.   └─vctrs::vec_default_cast(...)
   18.     ├─base::withRestarts(...)
   19.     │ └─base (local) withOneRestart(expr, restarts[[1L]])
   20.     │   └─base (local) doWithOneRestart(return(expr), restart)
   21.     └─vctrs::stop_incompatible_cast(...)
   22.       └─vctrs::stop_incompatible_type(...)
   23.         └─vctrs:::stop_incompatible(...)
   24.           └─vctrs:::stop_vctrs(...)
   25.             └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call)
  ── Error ('test-patterns.R:30:2'): create patterns, correct output ─────────────
  <vctrs_error_cast/vctrs_error_incompatible_type/vctrs_error_incompatible/vctrs_error/rlang_error/error/condition>
  Error in `as.character(cohort_ref[[2]]$x)`: Can't convert `x` <dbplyr_table_ident> to <character>.
  Backtrace:
       ▆
    1. ├─DrugUtilisation::mockDrugUtilisation(...) at test-patterns.R:30:1
    2. │ └─CDMConnector::cdm_from_con(...)
    3. │   └─CDMConnector::new_generated_cohort_set(...)
    4. │     ├─... %>% stringr::str_remove_all("[^A-Za-z0-9_]")
    5. │     ├─base::rev(...)
    6. │     ├─stringr::str_split(as.character(cohort_ref[[2]]$x), "\\.")
    7. │     │ └─stringr:::check_lengths(string, pattern)
    8. │     │   └─vctrs::vec_size_common(...)
    9. │     ├─base::as.character(cohort_ref[[2]]$x)
   10. │     └─vctrs:::as.character.vctrs_vctr(cohort_ref[[2]]$x)
   11. │       └─vctrs::vec_cast(x, character())
   12. ├─stringr::str_remove_all(., "[^A-Za-z0-9_]")
   13. │ └─stringr::str_replace_all(string, pattern, "")
   14. │   └─stringr:::check_lengths(string, pattern, replacement)
   15. │     └─vctrs::vec_size_common(...)
   16. └─vctrs (local) `<fn>`()
   17.   └─vctrs::vec_default_cast(...)
   18.     ├─base::withRestarts(...)
   19.     │ └─base (local) withOneRestart(expr, restarts[[1L]])
   20.     │   └─base (local) doWithOneRestart(return(expr), restart)
   21.     └─vctrs::stop_incompatible_cast(...)
   22.       └─vctrs::stop_incompatible_type(...)
   23.         └─vctrs:::stop_incompatible(...)
   24.           └─vctrs:::stop_vctrs(...)
   25.             └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call)
  ── Error ('test-readConceptList.R:2:3'): test inputs ───────────────────────────
  <vctrs_error_cast/vctrs_error_incompatible_type/vctrs_error_incompatible/vctrs_error/rlang_error/error/condition>
  Error in `as.character(cohort_ref[[2]]$x)`: Can't convert `x` <dbplyr_table_ident> to <character>.
  Backtrace:
       ▆
    1. ├─DrugUtilisation::mockDrugUtilisation(connectionDetails) at test-readConceptList.R:2:2
    2. │ └─CDMConnector::cdm_from_con(...)
    3. │   └─CDMConnector::new_generated_cohort_set(...)
    4. │     ├─... %>% stringr::str_remove_all("[^A-Za-z0-9_]")
    5. │     ├─base::rev(...)
    6. │     ├─stringr::str_split(as.character(cohort_ref[[2]]$x), "\\.")
    7. │     │ └─stringr:::check_lengths(string, pattern)
    8. │     │   └─vctrs::vec_size_common(...)
    9. │     ├─base::as.character(cohort_ref[[2]]$x)
   10. │     └─vctrs:::as.character.vctrs_vctr(cohort_ref[[2]]$x)
   11. │       └─vctrs::vec_cast(x, character())
   12. ├─stringr::str_remove_all(., "[^A-Za-z0-9_]")
   13. │ └─stringr::str_replace_all(string, pattern, "")
   14. │   └─stringr:::check_lengths(string, pattern, replacement)
   15. │     └─vctrs::vec_size_common(...)
   16. └─vctrs (local) `<fn>`()
   17.   └─vctrs::vec_default_cast(...)
   18.     ├─base::withRestarts(...)
   19.     │ └─base (local) withOneRestart(expr, restarts[[1L]])
   20.     │   └─base (local) doWithOneRestart(return(expr), restart)
   21.     └─vctrs::stop_incompatible_cast(...)
   22.       └─vctrs::stop_incompatible_type(...)
   23.         └─vctrs:::stop_incompatible(...)
   24.           └─vctrs:::stop_vctrs(...)
   25.             └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call)
  
  [ FAIL 8 | WARN 0 | SKIP 18 | PASS 0 ]
  Error: Test failures
  Execution halted