Running ‘testthat.R’ [104s/70s]
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(CDMConnector)
  > 
  > test_check("CDMConnector")
  Starting 2 test processes
  [ FAIL 5 | WARN 0 | SKIP 15 | PASS 167 ]
  
  ══ Skipped tests (15) ══════════════════════════════════════════════════════════
  • Capr cannot be loaded (1): 'test-db-generateCohortSet.R:158:3'
  • CirceR cannot be loaded (4): 'test-db-generateCohortSet.R:71:5',
    'test-db-generateCohortSet.R:84:3',
    'test-db-generateConceptCohortSet.R:200:5',
    'test-db-recordCohortAttrition.R:132:3'
  • TreatmentPatterns cannot be loaded (1): 'test-db-generateCohortSet.R:208:3'
  • any(write_schema == "") || is.null(con) is TRUE (5):
    'test-db-cohortTransformations.R:267:5',
    'test-db-cohortTransformations.R:267:5',
    'test-db-cohortTransformations.R:267:5',
    'test-db-cohortTransformations.R:267:5',
    'test-db-cohortTransformations.R:267:5'
  • failing test (1): 'test-db-dateadd.R:125:3'
  • manual test (3): 'test-Eunomia.R:2:3', 'test-db-copy_cdm_to.R:62:3',
    'test-db-generateCohortSet.R:190:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-db-generateCohortSet.R:278:3'): newGeneratedCohortSet works with prefix ──
  <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. ├─CDMConnector::new_generated_cohort_set(cdm$cohort) at test-db-generateCohortSet.R:278:2
    2. │ ├─... %>% stringr::str_remove_all("[^A-Za-z0-9_]")
    3. │ ├─base::rev(...)
    4. │ ├─stringr::str_split(as.character(cohort_ref[[2]]$x), "\\.")
    5. │ │ └─stringr:::check_lengths(string, pattern)
    6. │ │   └─vctrs::vec_size_common(...)
    7. │ ├─base::as.character(cohort_ref[[2]]$x)
    8. │ └─vctrs:::as.character.vctrs_vctr(cohort_ref[[2]]$x)
    9. │   └─vctrs::vec_cast(x, character())
   10. ├─stringr::str_remove_all(., "[^A-Za-z0-9_]")
   11. │ └─stringr::str_replace_all(string, pattern, "")
   12. │   └─stringr:::check_lengths(string, pattern, replacement)
   13. │     └─vctrs::vec_size_common(...)
   14. └─vctrs (local) `<fn>`()
   15.   └─vctrs::vec_default_cast(...)
   16.     ├─base::withRestarts(...)
   17.     │ └─base (local) withOneRestart(expr, restarts[[1L]])
   18.     │   └─base (local) doWithOneRestart(return(expr), restart)
   19.     └─vctrs::stop_incompatible_cast(...)
   20.       └─vctrs::stop_incompatible_type(...)
   21.         └─vctrs:::stop_incompatible(...)
   22.           └─vctrs:::stop_vctrs(...)
   23.             └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call)
  ── Error ('test-db-generateConceptCohortSet.R:217:5'): missing domains produce warning ──
  <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. ├─testthat::expect_warning(...) at test-db-generateConceptCohortSet.R:216:2
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─CDMConnector::generateConceptCohortSet(cdm, conceptSet = list(celecoxib = 1118084)) at test-db-generateConceptCohortSet.R:217:4
    8. │ └─CDMConnector::newGeneratedCohortSet(...)
    9. │   └─CDMConnector::new_generated_cohort_set(...)
   10. │     ├─... %>% stringr::str_remove_all("[^A-Za-z0-9_]")
   11. │     ├─base::rev(...)
   12. │     ├─stringr::str_split(as.character(cohort_ref[[2]]$x), "\\.")
   13. │     │ └─stringr:::check_lengths(string, pattern)
   14. │     │   └─vctrs::vec_size_common(...)
   15. │     ├─base::as.character(cohort_ref[[2]]$x)
   16. │     └─vctrs:::as.character.vctrs_vctr(cohort_ref[[2]]$x)
   17. │       └─vctrs::vec_cast(x, character())
   18. ├─stringr::str_remove_all(., "[^A-Za-z0-9_]")
   19. │ └─stringr::str_replace_all(string, pattern, "")
   20. │   └─stringr:::check_lengths(string, pattern, replacement)
   21. │     └─vctrs::vec_size_common(...)
   22. └─vctrs (local) `<fn>`()
   23.   └─vctrs::vec_default_cast(...)
   24.     ├─base::withRestarts(...)
   25.     │ └─base (local) withOneRestart(expr, restarts[[1L]])
   26.     │   └─base (local) doWithOneRestart(return(expr), restart)
   27.     └─vctrs::stop_incompatible_cast(...)
   28.       └─vctrs::stop_incompatible_type(...)
   29.         └─vctrs:::stop_incompatible(...)
   30.           └─vctrs:::stop_vctrs(...)
   31.             └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call)
  ── Error ('test-db-newGeneratedCohortSet.R:95:5'): duckdb - recordCohortAttrition ──
  <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. ├─CDMConnector (local) test_new_generated_cohort_set(con, cdm_schema, write_schema) at test-db-newGeneratedCohortSet.R:95:4
    2. │ └─CDMConnector::newGeneratedCohortSet(...) at test-db-newGeneratedCohortSet.R:63:2
    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-db-recordCohortAttrition.R:126:5'): duckdb - recordCohortAttrition ──
  <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. ├─CDMConnector (local) test_record_cohort_attrition(con, cdm_schema, write_schema) at test-db-recordCohortAttrition.R:126:4
    2. │ └─CDMConnector::generateConceptCohortSet(...) at test-db-recordCohortAttrition.R:6:2
    3. │   └─CDMConnector::newGeneratedCohortSet(...)
    4. │     └─CDMConnector::new_generated_cohort_set(...)
    5. │       ├─... %>% stringr::str_remove_all("[^A-Za-z0-9_]")
    6. │       ├─base::rev(...)
    7. │       ├─stringr::str_split(as.character(cohort_ref[[2]]$x), "\\.")
    8. │       │ └─stringr:::check_lengths(string, pattern)
    9. │       │   └─vctrs::vec_size_common(...)
   10. │       ├─base::as.character(cohort_ref[[2]]$x)
   11. │       └─vctrs:::as.character.vctrs_vctr(cohort_ref[[2]]$x)
   12. │         └─vctrs::vec_cast(x, character())
   13. ├─stringr::str_remove_all(., "[^A-Za-z0-9_]")
   14. │ └─stringr::str_replace_all(string, pattern, "")
   15. │   └─stringr:::check_lengths(string, pattern, replacement)
   16. │     └─vctrs::vec_size_common(...)
   17. └─vctrs (local) `<fn>`()
   18.   └─vctrs::vec_default_cast(...)
   19.     ├─base::withRestarts(...)
   20.     │ └─base (local) withOneRestart(expr, restarts[[1L]])
   21.     │   └─base (local) doWithOneRestart(return(expr), restart)
   22.     └─vctrs::stop_incompatible_cast(...)
   23.       └─vctrs::stop_incompatible_type(...)
   24.         └─vctrs:::stop_incompatible(...)
   25.           └─vctrs:::stop_vctrs(...)
   26.             └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call)
  ── Error ('test-memory-issue.R:12:3'): memory leak does not happen ─────────────
  <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. ├─CDMConnector::generateConceptCohortSet(...) at test-memory-issue.R:12:2
    2. │ └─CDMConnector::newGeneratedCohortSet(...)
    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 5 | WARN 0 | SKIP 15 | PASS 167 ]
  Error: Test failures
  Execution halted