Running ‘testthat.R’ [9s/11s]
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/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(pacta.multi.loanbook)
  > 
  > test_check("pacta.multi.loanbook")
  Saving _problems/test-2-match_loanbooks-24.R
  Saving _problems/test-3-prioritise_and_diagnose-43.R
  Saving _problems/test-4-analyse-30.R
  Saving _problems/test-run_calculate_match_success_rate-29.R
  Saving _problems/test-run_calculate_match_success_rate-64.R
  Saving _problems/test-run_calculate_match_success_rate-94.R
  Saving _problems/test-run_calculate_match_success_rate-132.R
  Saving _problems/test-run_calculate_match_success_rate-193.R
  [ FAIL 8 | WARN 0 | SKIP 0 | PASS 140 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-2-match_loanbooks.R:24:3'): with known input, runs without error ──
  Expected `suppressMessages(match_loanbooks(config))` not to throw any errors.
  Actually got a <simpleError> with message:
    attempt access index 10/10 in VECTOR_ELT
  ── Error ('test-3-prioritise_and_diagnose.R:40:3'): with known input, runs without error ──
  Error: '/tmp/Rtmpa13hws/test-data/output/matched_loanbooks/matched_lbk_raw_loanbook_1.csv' does not exist.
  Backtrace:
       ▆
    1. ├─... %>% readr::write_csv(manual_path, na = "") at test-3-prioritise_and_diagnose.R:40:3
    2. ├─readr::write_csv(., manual_path, na = "")
    3. │ └─readr::write_delim(...)
    4. │   ├─base::stopifnot(is.data.frame(x))
    5. │   └─base::is.data.frame(x)
    6. ├─dplyr::slice_head(., by = id_loan)
    7. ├─dplyr::slice_max(., order_by = score, by = id_loan)
    8. ├─readr::read_csv(matched_path, show_col_types = FALSE)
    9. │ └─vroom::vroom(...)
   10. │   └─vroom:::vroom_(...)
   11. └─vroom (local) `<fn>`("/tmp/Rtmpa13hws/test-data/output/matched_loanbooks/matched_lbk_raw_loanbook_1.csv")
   12.   └─vroom:::check_path(path)
  ── Failure ('test-4-analyse.R:30:3'): with known input, runs without error ─────
  Expected `suppressMessages(suppressWarnings(analyse(config)))` not to throw any errors.
  Actually got a <rlang_error> with message:
    x No matched prioritized loan book CSVs found.
    i Directory searched: '/tmp/Rtmpa13hws/test-data/output/prioritized_loanbooks_and_diagnostics'
    i Check the `dir_prioritized_loanbooks_and_diagnostics` parameter in your 'config.yml'.
  ── Error ('test-run_calculate_match_success_rate.R:28:3'): combine_raw_and_matched_loan_books identifies correct matched and unmatched loans ──
  Error in ``[.data.table`(matched, , `:=`(pick, none_is_one(score) | some_is_one(score)), by = id_2dii)`: attempt access index 10/10 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─test_raw %>% ... at test-run_calculate_match_success_rate.R:28:3
   2. └─r2dii.match::match_name(...)
   3.   └─r2dii.match:::match_name_impl(...)
   4.     ├─...[]
   5.     └─data.table:::`[.data.table`(...)
  ── Error ('test-run_calculate_match_success_rate.R:62:3'): combine_raw_and_matched_loan_books removes group_id from id_loan where needed (GH #90) ──
  Error in ``[.data.table`(matched, , `:=`(pick, none_is_one(score) | some_is_one(score)), by = id_2dii)`: attempt access index 10/10 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─... %>% ... at test-run_calculate_match_success_rate.R:62:3
   2. ├─dplyr::mutate(., id_loan = paste(id_loan, group_id, sep = "_"))
   3. └─r2dii.match::match_name(...)
   4.   └─r2dii.match:::match_name_impl(...)
   5.     ├─...[]
   6.     └─data.table:::`[.data.table`(...)
  ── Error ('test-run_calculate_match_success_rate.R:92:3'): combine_raw_and_matched_loan_books removes sector_abcd from id_loan where needed (GH #90) ──
  Error in ``[.data.table`(matched, , `:=`(pick, none_is_one(score) | some_is_one(score)), by = id_2dii)`: attempt access index 10/10 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─... %>% ... at test-run_calculate_match_success_rate.R:92:3
   2. ├─dplyr::mutate(., id_loan = paste(id_loan, sector_abcd, sep = "_"))
   3. └─r2dii.match::match_name(...)
   4.   └─r2dii.match:::match_name_impl(...)
   5.     ├─...[]
   6.     └─data.table:::`[.data.table`(...)
  ── Error ('test-run_calculate_match_success_rate.R:130:3'): calculate_match_success_rate returns results for each group of variable by_group available in matched_prioritized ──
  Error in ``[.data.table`(matched, , `:=`(pick, none_is_one(score) | some_is_one(score)), by = id_2dii)`: attempt access index 10/10 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─... %>% ... at test-run_calculate_match_success_rate.R:130:3
   2. ├─dplyr::filter(., .data[["level"]] == "direct_loantaker")
   3. └─r2dii.match::match_name(...)
   4.   └─r2dii.match:::match_name_impl(...)
   5.     ├─...[]
   6.     └─data.table:::`[.data.table`(...)
  ── Error ('test-run_calculate_match_success_rate.R:191:3'): calculate_match_success_rate can only be calculated for by_groups that are available the raw and the matched priortized loan books ──
  Error in ``[.data.table`(matched, , `:=`(pick, none_is_one(score) | some_is_one(score)), by = id_2dii)`: attempt access index 10/10 in VECTOR_ELT
  Backtrace:
      ▆
   1. ├─... %>% ... at test-run_calculate_match_success_rate.R:191:3
   2. ├─dplyr::filter(., .data[["level"]] == "direct_loantaker")
   3. └─r2dii.match::match_name(...)
   4.   └─r2dii.match:::match_name_impl(...)
   5.     ├─...[]
   6.     └─data.table:::`[.data.table`(...)
  
  [ FAIL 8 | WARN 0 | SKIP 0 | PASS 140 ]
  Error:
  ! Test failures.
  Execution halted