Running ‘testthat.R’ [204s/163s]
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 36 | SKIP 19 | PASS 139 ]
  
  ══ Skipped tests (19) ══════════════════════════════════════════════════════════
  • On CRAN (19): 'test-benchmarkDUS.R:2:3', '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:349:3', 'test-indication.R:3:3',
    'test-indication.R:185:3', 'test-indication.R:339:3',
    'test-indication.R:464:3', 'test-drugUse.R:2:3', 'test-drugUse.R:40:3',
    'test-drugUse.R:254:3', 'test-drugUse.R:455:3', 'test-drugUse.R:597:3',
    'test-drugUse.R:847:3', 'test-drugUse.R:868:3', 'test-drugUse.R:914:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-generateConceptCohortSet.R:4:3'): test inputs ────────────────
  Expected `cdm <- generateConceptCohortSet(cdm, indications, "indications_cohort")` to run without any errors.
  i Actually got a <rlang_error> with text:
    No known SQL translation
  ── Failure ('test-generateConceptCohortSet.R:9:3'): test inputs ────────────────
  "indications_cohort" %in% names(cdm) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-generateConceptCohortSet.R:10:3'): test inputs ───────────────
  !is.null(attr(cdm[["indications_cohort"]], "cdm_reference", exact = TRUE)) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Error ('test-indication.R:592:3'): summariseIndication ──────────────────────
  Error in `CDMConnector::datediff()`: No known SQL translation
  Backtrace:
       ▆
    1. ├─cdm[["cohort1"]] %>% ... at test-indication.R:592:3
    2. ├─DrugUtilisation::addIndication(...)
    3. │ └─DrugUtilisation:::addCohortIndication(...)
    4. │   ├─... %>% ...
    5. │   └─PatientProfiles::addCohortIntersectFlag(...)
    6. │     └─x %>% ...
    7. ├─dplyr::compute(., temporary = FALSE, overwrite = TRUE, name = uniqueTmpName())
    8. ├─DrugUtilisation:::addNoneIndication(., gap)
    9. │ └─base::colnames(x)
   10. │   └─base::is.data.frame(x)
   11. ├─PatientProfiles::addIntersect(...)
   12. │ └─... %>% ...
   13. ├─dplyr::mutate(., censor_date = .data[[censorDate %||% "censor_date"]])
   14. ├─dplyr::mutate(...)
   15. ├─PatientProfiles::addFutureObservation(...)
   16. │ └─x %>% ...
   17. ├─PatientProfiles::addDemographics(...)
   18. │ └─x %>% dplyr::compute()
   19. ├─dplyr::compute(.)
   20. ├─omopgenerics:::compute.cdm_table(.)
   21. │ ├─dplyr::compute(...)
   22. │ └─CDMConnector:::compute.db_cdm(...)
   23. │   └─CDMConnector:::.computeQuery(...)
   24. │     └─dbplyr::sql_render(x)
   25. │       ├─dbplyr::sql_render(...)
   26. │       └─dbplyr:::sql_render.tbl_lazy(...)
   27. │         ├─dbplyr::sql_render(...)
   28. │         └─dbplyr:::sql_render.lazy_query(...)
   29. │           ├─dbplyr::sql_build(query, con = con, sql_options = sql_options)
   30. │           └─dbplyr:::sql_build.lazy_select_query(query, con = con, sql_options = sql_options)
   31. │             └─dbplyr:::get_select_sql(...)
   32. │               └─dbplyr:::translate_select_sql(con, select)
   33. │                 └─dbplyr::translate_sql_(...)
   34. │                   └─base::lapply(...)
   35. │                     └─dbplyr (local) FUN(X[[i]], ...)
   36. │                       ├─dbplyr::escape(eval_tidy(x, mask), con = con)
   37. │                       └─rlang::eval_tidy(x, mask)
   38. └─CDMConnector::datediff
   39.   └─cli::cli_abort(...)
   40.     └─rlang::abort(...)
  ── Failure ('test-largeScaleCharacteristics.R:8:3'): basic functionality summariseCodelist ──
  Expected `summariseCharacteristicsFromCodelist(cdm[["cohort1"]], conceptSet = conceptSet)` to run without any errors.
  i Actually got a <rlang_error> with text:
    No known SQL translation
  ── Failure ('test-largeScaleCharacteristics.R:14:3'): basic functionality summariseCodelist ──
  Expected `summariseCharacteristicsFromCodelist(...)` to run without any errors.
  i Actually got a <rlang_error> with text:
    No known SQL translation
  ── Failure ('test-summariseTreatment.R:3:3'): test summariseTreatment ──────────
  Expected `... <- NULL` to run without any errors.
  i Actually got a <rlang_error> with text:
    No known SQL translation
  ── Error ('test-summariseTreatment.R:11:3'): test summariseTreatment ───────────
  Error in `eval(code, test_env)`: object 'x' not found
  Backtrace:
      ▆
   1. ├─testthat::expect_true(inherits(x, "summarised_result")) at test-summariseTreatment.R:11:3
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─base::inherits(x, "summarised_result")
  
  [ FAIL 8 | WARN 36 | SKIP 19 | PASS 139 ]
  Error: Test failures
  Execution halted