Running ‘testthat.R’ [5s/5s]
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(tidyllm)
  
  Attaching package: 'tidyllm'
  
  The following object is masked from 'package:stats':
  
      embed
  
  > 
  > test_check("tidyllm")
  Saving _problems/test_api_claude-82.R
  Saving _problems/test_api_groq-75.R
  Saving _problems/test_api_mistral-65.R
  Saving _problems/test_api_ollama-87.R
  Saving _problems/test_api_openai-61.R
  Saving _problems/test_api_openai-143.R
  Saving _problems/test_api_openai-169.R
  Saving _problems/test_api_openai-224.R
  Saving _problems/test_message_retrieval-152.R
  Saving _problems/test_message_retrieval-161.R
  Saving _problems/test_message_retrieval-188.R
  [ FAIL 11 | WARN 0 | SKIP 0 | PASS 307 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test_api_claude.R:82:5'): claude returns expected response ──────────
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `purrr::map_dfr(api_names, function(api) {     rl_info <- .tidyllm_rate_limit_env[[api]]     if (is.null(rl_info$last_request) || is.null(rl_info$requests_remaining) || is.null(rl_info$tokens_remaining)) {         warning(glue::glue("Incomplete rate limit data for API: {api}."))     }     tibble::tibble(api = api, last_request = rl_info$last_request, requests_remaining = rl_info$requests_remaining, requests_reset_time = rl_info$requests_reset_time, tokens_remaining = rl_info$tokens_remaining, tokens_reset_time = rl_info$tokens_reset_time) })`: The package "dplyr" is required for `map_dfr()`.
  Backtrace:
       ▆
    1. ├─httptest2::with_mock_dir(...) at test_api_claude.R:44:3
    2. │ ├─httptest2:::with_mock_path(...)
    3. │ │ └─base::eval.parent(expr)
    4. │ │   └─base::eval(expr, p)
    5. │ └─httptest2::with_mock_api(expr)
    6. │   └─base::eval.parent(expr)
    7. │     └─base::eval(expr, p)
    8. └─tidyllm::rate_limit_info("claude") at test_api_claude.R:82:5
    9.   └─purrr::map_dfr(...)
   10.     └─rlang::check_installed("dplyr", "for `map_dfr()`.")
  ── Error ('test_api_groq.R:75:5'): groq returns expected response ──────────────
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `purrr::map_dfr(api_names, function(api) {     rl_info <- .tidyllm_rate_limit_env[[api]]     if (is.null(rl_info$last_request) || is.null(rl_info$requests_remaining) || is.null(rl_info$tokens_remaining)) {         warning(glue::glue("Incomplete rate limit data for API: {api}."))     }     tibble::tibble(api = api, last_request = rl_info$last_request, requests_remaining = rl_info$requests_remaining, requests_reset_time = rl_info$requests_reset_time, tokens_remaining = rl_info$tokens_remaining, tokens_reset_time = rl_info$tokens_reset_time) })`: The package "dplyr" is required for `map_dfr()`.
  Backtrace:
       ▆
    1. ├─httptest2::with_mock_dir(...) at test_api_groq.R:42:3
    2. │ ├─httptest2:::with_mock_path(...)
    3. │ │ └─base::eval.parent(expr)
    4. │ │   └─base::eval(expr, p)
    5. │ └─httptest2::with_mock_api(expr)
    6. │   └─base::eval.parent(expr)
    7. │     └─base::eval(expr, p)
    8. └─tidyllm::rate_limit_info("groq") at test_api_groq.R:75:5
    9.   └─purrr::map_dfr(...)
   10.     └─rlang::check_installed("dplyr", "for `map_dfr()`.")
  ── Error ('test_api_mistral.R:65:5'): mistral returns expected response ────────
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `purrr::map_dfr(x@message_history, ~{     tibble::tibble(role = .x$role, content = .x$content) })`: The package "dplyr" is required for `map_dfr()`.
  Backtrace:
       ▆
    1. ├─httptest2::with_mock_dir(...) at test_api_mistral.R:38:3
    2. │ ├─httptest2:::with_mock_path(...)
    3. │ │ └─base::eval.parent(expr)
    4. │ │   └─base::eval(expr, p)
    5. │ └─httptest2::with_mock_api(expr)
    6. │   └─base::eval.parent(expr)
    7. │     └─base::eval(expr, p)
    8. ├─tibble::as_tibble(result) at test_api_mistral.R:65:5
    9. └─tidyllm (local) `as_tibble.tidyllm::LLMMessage`(result)
   10.   └─purrr::map_dfr(...)
   11.     └─rlang::check_installed("dplyr", "for `map_dfr()`.")
  ── Error ('test_api_ollama.R:87:5'): ollama returns expected response ──────────
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `purrr::map_dfr(x@message_history, ~{     tibble::tibble(role = .x$role, content = .x$content) })`: The package "dplyr" is required for `map_dfr()`.
  Backtrace:
       ▆
    1. ├─httptest2::with_mock_dir(...) at test_api_ollama.R:77:3
    2. │ ├─httptest2:::with_mock_path(...)
    3. │ │ └─base::eval.parent(expr)
    4. │ │   └─base::eval(expr, p)
    5. │ └─httptest2::with_mock_api(expr)
    6. │   └─base::eval.parent(expr)
    7. │     └─base::eval(expr, p)
    8. ├─tibble::as_tibble(result) at test_api_ollama.R:87:5
    9. └─tidyllm (local) `as_tibble.tidyllm::LLMMessage`(result)
   10.   └─purrr::map_dfr(...)
   11.     └─rlang::check_installed("dplyr", "for `map_dfr()`.")
  ── Error ('test_api_openai.R:61:5'): openai returns expected response ──────────
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `purrr::map_dfr(x@message_history, ~{     tibble::tibble(role = .x$role, content = .x$content) })`: The package "dplyr" is required for `map_dfr()`.
  Backtrace:
       ▆
    1. ├─httptest2::with_mock_dir(...) at test_api_openai.R:43:3
    2. │ ├─httptest2:::with_mock_path(...)
    3. │ │ └─base::eval.parent(expr)
    4. │ │   └─base::eval(expr, p)
    5. │ └─httptest2::with_mock_api(expr)
    6. │   └─base::eval.parent(expr)
    7. │     └─base::eval(expr, p)
    8. ├─tibble::as_tibble(result) at test_api_openai.R:61:5
    9. └─tidyllm (local) `as_tibble.tidyllm::LLMMessage`(result)
   10.   └─purrr::map_dfr(...)
   11.     └─rlang::check_installed("dplyr", "for `map_dfr()`.")
  ── Error ('test_api_openai.R:141:5'): tidyllm_schema() handles single element correctly ──
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `purrr::map_dfr(selected_replies, function(reply) {     meta <- reply$meta     tibble::tibble(model = if (!is.null(meta$model))          meta$model     else NA_character_, timestamp = if (!is.null(meta$timestamp))          meta$timestamp     else NA_character_, prompt_tokens = if (!is.null(meta$prompt_tokens))          meta$prompt_tokens     else NA_integer_, completion_tokens = if (!is.null(meta$completion_tokens))          meta$completion_tokens     else NA_integer_, total_tokens = if (!is.null(meta$total_tokens))          meta$total_tokens     else NA_integer_, stream = if (!is.null(meta$stream))          meta$stream     else NA, api_specific = list(meta$specific_metadata)) })`: The package "dplyr" is required for `map_dfr()`.
  Backtrace:
       ▆
    1. ├─httptest2::with_mock_dir(...) at test_api_openai.R:126:3
    2. │ ├─httptest2:::with_mock_path(...)
    3. │ │ └─base::eval.parent(expr)
    4. │ │   └─base::eval(expr, p)
    5. │ └─httptest2::with_mock_api(expr)
    6. │   └─base::eval.parent(expr)
    7. │     └─base::eval(expr, p)
    8. ├─... %>% get_metadata() at test_api_openai.R:141:5
    9. └─tidyllm::get_metadata(.)
   10.   └─purrr::map_dfr(...)
   11.     └─rlang::check_installed("dplyr", "for `map_dfr()`.")
  ── Error ('test_api_openai.R:167:5'): tidyllm_schema() handles multiple elements correctly ──
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `purrr::map_dfr(selected_replies, function(reply) {     meta <- reply$meta     tibble::tibble(model = if (!is.null(meta$model))          meta$model     else NA_character_, timestamp = if (!is.null(meta$timestamp))          meta$timestamp     else NA_character_, prompt_tokens = if (!is.null(meta$prompt_tokens))          meta$prompt_tokens     else NA_integer_, completion_tokens = if (!is.null(meta$completion_tokens))          meta$completion_tokens     else NA_integer_, total_tokens = if (!is.null(meta$total_tokens))          meta$total_tokens     else NA_integer_, stream = if (!is.null(meta$stream))          meta$stream     else NA, api_specific = list(meta$specific_metadata)) })`: The package "dplyr" is required for `map_dfr()`.
  Backtrace:
       ▆
    1. ├─httptest2::with_mock_dir(...) at test_api_openai.R:151:3
    2. │ ├─httptest2:::with_mock_path(...)
    3. │ │ └─base::eval.parent(expr)
    4. │ │   └─base::eval(expr, p)
    5. │ └─httptest2::with_mock_api(expr)
    6. │   └─base::eval.parent(expr)
    7. │     └─base::eval(expr, p)
    8. ├─... %>% get_metadata() at test_api_openai.R:167:5
    9. └─tidyllm::get_metadata(.)
   10.   └─purrr::map_dfr(...)
   11.     └─rlang::check_installed("dplyr", "for `map_dfr()`.")
  ── Error ('test_api_openai.R:224:5'): list_openai_batches functions correctly ──
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `purrr::map_dfr(batch_data, ~tibble::tibble(batch_id = .x$id, status = .x$status, created_at = as.POSIXct(.x$created_at, origin = "1970-01-01", tz = "UTC"), expires_at = as.POSIXct(.x$expires_at, origin = "1970-01-01", tz = "UTC"), request_total = .x$request_counts$total, request_completed = .x$request_counts$completed, request_failed = .x$request_counts$failed))`: The package "dplyr" is required for `map_dfr()`.
  Backtrace:
       ▆
    1. ├─httptest2::with_mock_dir(...) at test_api_openai.R:217:3
    2. │ ├─httptest2:::with_mock_path(...)
    3. │ │ └─base::eval.parent(expr)
    4. │ │   └─base::eval(expr, p)
    5. │ └─httptest2::with_mock_api(expr)
    6. │   └─base::eval.parent(expr)
    7. │     └─base::eval(expr, p)
    8. └─tidyllm::list_openai_batches() at test_api_openai.R:224:5
    9.   └─purrr::map_dfr(...)
   10.     └─rlang::check_installed("dplyr", "for `map_dfr()`.")
  ── Error ('test_message_retrieval.R:152:3'): get_metadata works for multiple assistant replies ──
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `purrr::map_dfr(selected_replies, function(reply) {     meta <- reply$meta     tibble::tibble(model = if (!is.null(meta$model))          meta$model     else NA_character_, timestamp = if (!is.null(meta$timestamp))          meta$timestamp     else NA_character_, prompt_tokens = if (!is.null(meta$prompt_tokens))          meta$prompt_tokens     else NA_integer_, completion_tokens = if (!is.null(meta$completion_tokens))          meta$completion_tokens     else NA_integer_, total_tokens = if (!is.null(meta$total_tokens))          meta$total_tokens     else NA_integer_, stream = if (!is.null(meta$stream))          meta$stream     else NA, api_specific = list(meta$specific_metadata)) })`: The package "dplyr" is required for `map_dfr()`.
  Backtrace:
      ▆
   1. └─tidyllm::get_metadata(llm) at test_message_retrieval.R:152:3
   2.   └─purrr::map_dfr(...)
   3.     └─rlang::check_installed("dplyr", "for `map_dfr()`.")
  ── Error ('test_message_retrieval.R:161:3'): get_metadata handles missing with an NA row ──
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `purrr::map_dfr(selected_replies, function(reply) {     meta <- reply$meta     tibble::tibble(model = if (!is.null(meta$model))          meta$model     else NA_character_, timestamp = if (!is.null(meta$timestamp))          meta$timestamp     else NA_character_, prompt_tokens = if (!is.null(meta$prompt_tokens))          meta$prompt_tokens     else NA_integer_, completion_tokens = if (!is.null(meta$completion_tokens))          meta$completion_tokens     else NA_integer_, total_tokens = if (!is.null(meta$total_tokens))          meta$total_tokens     else NA_integer_, stream = if (!is.null(meta$stream))          meta$stream     else NA, api_specific = list(meta$specific_metadata)) })`: The package "dplyr" is required for `map_dfr()`.
  Backtrace:
      ▆
   1. └─tidyllm::get_metadata(llm) at test_message_retrieval.R:161:3
   2.   └─purrr::map_dfr(...)
   3.     └─rlang::check_installed("dplyr", "for `map_dfr()`.")
  ── Error ('test_message_retrieval.R:188:3'): get_metadata retrieves metadata for a specific index ──
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `purrr::map_dfr(selected_replies, function(reply) {     meta <- reply$meta     tibble::tibble(model = if (!is.null(meta$model))          meta$model     else NA_character_, timestamp = if (!is.null(meta$timestamp))          meta$timestamp     else NA_character_, prompt_tokens = if (!is.null(meta$prompt_tokens))          meta$prompt_tokens     else NA_integer_, completion_tokens = if (!is.null(meta$completion_tokens))          meta$completion_tokens     else NA_integer_, total_tokens = if (!is.null(meta$total_tokens))          meta$total_tokens     else NA_integer_, stream = if (!is.null(meta$stream))          meta$stream     else NA, api_specific = list(meta$specific_metadata)) })`: The package "dplyr" is required for `map_dfr()`.
  Backtrace:
      ▆
   1. └─tidyllm::get_metadata(llm, .index = 2) at test_message_retrieval.R:188:3
   2.   └─purrr::map_dfr(...)
   3.     └─rlang::check_installed("dplyr", "for `map_dfr()`.")
  
  [ FAIL 11 | WARN 0 | SKIP 0 | PASS 307 ]
  Error:
  ! Test failures.
  Execution halted