Running ‘testthat.R’ [119s/224s]
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")
  trying URL 'https://example-data.ohdsi.dev/GiBleed.zip'
  Content type 'application/zip' length 6754786 bytes (6.4 MB)
  ==================================================
  downloaded 6.4 MB
  
  
  Download completed!
  Creating CDM database /home/hornik/tmp/scratch/RtmpT9YpDg/file6f15c27c8346c/GiBleed_5.3.zip
  =======>-----------------------   24% | ETA:  7s
  [ FAIL 5 | WARN 0 | SKIP 18 | PASS 196 ]
  
  ══ Skipped tests (18) ══════════════════════════════════════════════════════════
  • Capr cannot be loaded (1): 'test-db-generateCohortSet.R:77:3'
  • CirceR cannot be loaded (8): 'test-db-custom_cohort_creation.R:42:5',
    'test-db-generateCohortSet.R:64:5', 'test-db-generateCohortSet.R:210:3',
    'test-db-generateConceptCohortSet.R:282:5',
    'test-db-newGeneratedCohortSet.R:126:3',
    'test-db-newGeneratedCohortSet.R:179:3',
    'test-db-recordCohortAttrition.R:133:3',
    'test-write_prefix_cohort_generation_snowflake.R:3:3'
  • TreatmentPatterns cannot be loaded (1): 'test-db-generateCohortSet.R:127:3'
  • arrow cannot be loaded (1): 'test-local_cdm.R:3:3'
  • eunomia_is_available("empty_cdm") is not TRUE (1): 'test-Eunomia.R:42:3'
  • failing test (1): 'test-db-dateadd.R:126:3'
  • manual test (5): 'test-Eunomia.R:2:3', 'test-db-copy_cdm_to.R:62:3',
    'test-db-generateCohortSet.R:108:3', 'test-db-generateCohortSet.R:243:3',
    'test-db-write_schema_with_database.R:5:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-db-cohortTransformations.R:258:5'): duckdb - cohort_collapse ───
  Error in `dbplyr::win_over()`: No known SQL translation
  Backtrace:
       ▆
    1. ├─CDMConnector (local) test_cohort_collapse(con, write_schema) at test-db-cohortTransformations.R:258:5
    2. │ └─... %>% ... at test-db-cohortTransformations.R:74:3
    3. ├─dplyr::mutate(., dplyr::across(dplyr::matches("id"), as.double))
    4. ├─dplyr::mutate(., dplyr::across(dplyr::matches("date"), as.Date))
    5. ├─dplyr::arrange(...)
    6. ├─dplyr::tibble(.)
    7. │ └─tibble:::tibble_quos(xs, .rows, .name_repair)
    8. │   └─rlang::eval_tidy(xs[[j]], mask)
    9. ├─dplyr::collect(.)
   10. ├─dbplyr:::collect.tbl_sql(.)
   11. │ └─dbplyr::db_sql_render(x$src$con, x, cte = cte)
   12. │   ├─dbplyr::db_sql_render(con, sql, ..., sql_options = sql_options)
   13. │   └─dbplyr:::db_sql_render.DBIConnection(con, sql, ..., sql_options = sql_options)
   14. │     ├─dbplyr::sql_render(sql, con = con, ..., sql_options = sql_options)
   15. │     └─dbplyr:::sql_render.tbl_lazy(sql, con = con, ..., sql_options = sql_options)
   16. │       ├─dbplyr::sql_render(...)
   17. │       └─dbplyr:::sql_render.lazy_query(...)
   18. │         ├─dbplyr::sql_build(query, con = con, sql_options = sql_options)
   19. │         └─dbplyr:::sql_build.lazy_select_query(query, con = con, sql_options = sql_options)
   20. │           ├─dbplyr::sql_build(op$x, con, sql_options = sql_options)
   21. │           └─dbplyr:::sql_build.lazy_select_query(op$x, con, sql_options = sql_options)
   22. │             ├─dbplyr::sql_build(op$x, con, sql_options = sql_options)
   23. │             └─dbplyr:::sql_build.lazy_select_query(op$x, con, sql_options = sql_options)
   24. │               └─dbplyr:::get_select_sql(...)
   25. │                 └─dbplyr:::translate_select_sql(con, select)
   26. │                   └─dbplyr::translate_sql_(...)
   27. │                     └─base::lapply(...)
   28. │                       └─dbplyr (local) FUN(X[[i]], ...)
   29. │                         ├─dbplyr::escape(eval_tidy(x, mask), con = con)
   30. │                         └─rlang::eval_tidy(x, mask)
   31. ├─dplyr::coalesce(...)
   32. └─dbplyr::win_over
   33.   └─cli::cli_abort(...)
   34.     └─rlang::abort(...)
  ── Failure ('test-db-generateConceptCohortSet.R:322:5'): Regimen domain does not cause error ──
  Expected `{ ... }` to run without any errors.
  i Actually got a <rlang_error> with text:
    No known SQL translation
  ── Failure ('test-db-generateConceptCohortSet.R:328:3'): Regimen domain does not cause error ──
  cdm$cohort is not an S3 object
  ── Error ('test-db-recordCohortAttrition.R:127:5'): duckdb - recordCohortAttrition ──
  Error in `dbplyr::win_over()`: No known SQL translation
  Backtrace:
       ▆
    1. ├─CDMConnector (local) test_record_cohort_attrition(con, cdm_schema, write_schema) at test-db-recordCohortAttrition.R:127:5
    2. │ └─CDMConnector::generateConceptCohortSet(...) at test-db-recordCohortAttrition.R:9:3
    3. │   └─... %>% ...
    4. ├─dplyr::compute(., name = name, temporary = FALSE, overwrite = overwrite)
    5. ├─omopgenerics:::compute.cdm_table(...)
    6. │ ├─dplyr::compute(...)
    7. │ └─CDMConnector:::compute.db_cdm(...)
    8. │   └─CDMConnector:::.computeQuery(...)
    9. │     └─dbplyr::sql_render(x)
   10. │       ├─dbplyr::sql_render(...)
   11. │       └─dbplyr:::sql_render.tbl_lazy(...)
   12. │         ├─dbplyr::sql_render(...)
   13. │         └─dbplyr:::sql_render.lazy_query(...)
   14. │           ├─dbplyr::sql_build(query, con = con, sql_options = sql_options)
   15. │           └─dbplyr:::sql_build.lazy_select_query(query, con = con, sql_options = sql_options)
   16. │             ├─dbplyr::sql_build(op$x, con, sql_options = sql_options)
   17. │             └─dbplyr:::sql_build.lazy_select_query(op$x, con, sql_options = sql_options)
   18. │               ├─dbplyr::sql_build(op$x, con, sql_options = sql_options)
   19. │               └─dbplyr:::sql_build.lazy_select_query(op$x, con, sql_options = sql_options)
   20. │                 ├─dbplyr::sql_build(op$x, con, sql_options = sql_options)
   21. │                 └─dbplyr:::sql_build.lazy_select_query(op$x, con, sql_options = sql_options)
   22. │                   └─dbplyr:::get_select_sql(...)
   23. │                     └─dbplyr:::translate_select_sql(con, select)
   24. │                       └─dbplyr::translate_sql_(...)
   25. │                         └─base::lapply(...)
   26. │                           └─dbplyr (local) FUN(X[[i]], ...)
   27. │                             ├─dbplyr::escape(eval_tidy(x, mask), con = con)
   28. │                             └─rlang::eval_tidy(x, mask)
   29. ├─dplyr::coalesce(...)
   30. └─dbplyr::win_over
   31.   └─cli::cli_abort(...)
   32.     └─rlang::abort(...)
  ── Error ('test-memory-issue.R:14:3'): memory leak does not happen ─────────────
  Error in `dbplyr::win_over()`: No known SQL translation
  Backtrace:
       ▆
    1. ├─CDMConnector::generateConceptCohortSet(...) at test-memory-issue.R:14:3
    2. │ └─... %>% ...
    3. ├─dplyr::compute(., name = name, temporary = FALSE, overwrite = overwrite)
    4. ├─omopgenerics:::compute.cdm_table(...)
    5. │ ├─dplyr::compute(...)
    6. │ └─CDMConnector:::compute.db_cdm(...)
    7. │   └─CDMConnector:::.computeQuery(...)
    8. │     └─dbplyr::sql_render(x)
    9. │       ├─dbplyr::sql_render(...)
   10. │       └─dbplyr:::sql_render.tbl_lazy(...)
   11. │         ├─dbplyr::sql_render(...)
   12. │         └─dbplyr:::sql_render.lazy_query(...)
   13. │           ├─dbplyr::sql_build(query, con = con, sql_options = sql_options)
   14. │           └─dbplyr:::sql_build.lazy_select_query(query, con = con, sql_options = sql_options)
   15. │             ├─dbplyr::sql_build(op$x, con, sql_options = sql_options)
   16. │             └─dbplyr:::sql_build.lazy_select_query(op$x, con, sql_options = sql_options)
   17. │               ├─dbplyr::sql_build(op$x, con, sql_options = sql_options)
   18. │               └─dbplyr:::sql_build.lazy_select_query(op$x, con, sql_options = sql_options)
   19. │                 ├─dbplyr::sql_build(op$x, con, sql_options = sql_options)
   20. │                 └─dbplyr:::sql_build.lazy_select_query(op$x, con, sql_options = sql_options)
   21. │                   └─dbplyr:::get_select_sql(...)
   22. │                     └─dbplyr:::translate_select_sql(con, select)
   23. │                       └─dbplyr::translate_sql_(...)
   24. │                         └─base::lapply(...)
   25. │                           └─dbplyr (local) FUN(X[[i]], ...)
   26. │                             ├─dbplyr::escape(eval_tidy(x, mask), con = con)
   27. │                             └─rlang::eval_tidy(x, mask)
   28. ├─dplyr::coalesce(...)
   29. └─dbplyr::win_over
   30.   └─cli::cli_abort(...)
   31.     └─rlang::abort(...)
  
  [ FAIL 5 | WARN 0 | SKIP 18 | PASS 196 ]
  Error: Test failures
  In addition: Warning messages:
  1: Connection is garbage-collected, use dbDisconnect() to avoid this. 
  2: Connection is garbage-collected, use dbDisconnect() to avoid this. 
  3: Database is garbage-collected, use dbDisconnect(con, shutdown=TRUE) or duckdb::duckdb_shutdown(drv) to avoid this. 
  4: Database is garbage-collected, use dbDisconnect(con, shutdown=TRUE) or duckdb::duckdb_shutdown(drv) to avoid this. 
  5: Connection is garbage-collected, use dbDisconnect() to avoid this. 
  6: Database is garbage-collected, use dbDisconnect(con, shutdown=TRUE) or duckdb::duckdb_shutdown(drv) to avoid this. 
  7: Connection is garbage-collected, use dbDisconnect() to avoid this. 
  Execution halted
  Warning message:
  Database is garbage-collected, use dbDisconnect(con, shutdown=TRUE) or duckdb::duckdb_shutdown(drv) to avoid this.