Running ‘testthat.R’ [8s/14s]
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(chattr)
  > library(shiny)
  > 
  > test_check("chattr")
  Enter file name: Enter file name: [ FAIL 1 | WARN 2 | SKIP 26 | PASS 38 ]
  
  ══ Skipped tests (26) ══════════════════════════════════════════════════════════
  • On CRAN (26): 'test-app-server.R:30:3', 'test-app-server.R:48:3',
    'test-app-ui.R:2:3', 'test-app-ui.R:12:3', 'test-app-ui.R:17:3',
    'test-app-ui.R:24:3', 'test-backend-databricks.R:20:3',
    'test-backend-ellmer.R:22:3', 'test-backend-openai.R:2:3',
    'test-backend-openai.R:12:3', 'test-ch-defaults-save.R:3:3',
    'test-ch_context.R:2:3', 'test-ch_context.R:12:3', 'test-ch_defaults.R:2:3',
    'test-ch_defaults.R:9:3', 'test-ch_defaults.R:19:3',
    'test-chattr-defaults.R:3:3', 'test-chattr-test.R:4:3',
    'test-chattr-test.R:17:3', 'test-chattr-use.R:7:7', 'test-chattr-use.R:47:7',
    'test-chattr-use.R:53:3', 'test-chattr-use.R:75:3', 'test-chattr-use.R:83:7',
    'test-utils.R:6:3', 'test-utils.R:20:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-backend-ellmer.R:41:3'): Ellmer history works ──────────────────
  <purrr_error_indexed/rlang_error/error/condition>
  Error in `map(x, ~{
      ellmer::Turn(role = .x$role, contents = list(ellmer::ContentText(.x$content)), 
          tokens = .x$tokens %||% c(0, 0))
  })`: i In index: 1.
  Caused by error:
  ! <ellmer::Turn> object properties are invalid:
  - @tokens must be length three
  Backtrace:
       ▆
    1. ├─testthat::expect_silent(...) at test-backend-ellmer.R:41:3
    2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ ├─withr::with_output_sink(...)
    5. │   │ │ └─base::force(code)
    6. │   │ ├─base::withCallingHandlers(...)
    7. │   │ └─base::withVisible(code)
    8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    9. ├─chattr:::ch_ellmer_history(list(list(role = "user", contents = "this is a test")))
   10. │ └─purrr::map(...)
   11. │   └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
   12. │     ├─purrr:::with_indexed_errors(...)
   13. │     │ └─base::withCallingHandlers(...)
   14. │     ├─purrr:::call_with_cleanup(...)
   15. │     └─chattr (local) .f(.x[[i]], ...)
   16. │       └─ellmer::Turn(...)
   17. │         └─S7::new_object(...)
   18. │           └─S7::validate(object, recursive = !parent_validated)
   19. │             └─base::stop(msg, call. = FALSE)
   20. └─base::.handleSimpleError(...)
   21.   └─purrr (local) h(simpleError(msg, call))
   22.     └─cli::cli_abort(...)
   23.       └─rlang::abort(...)
  
  [ FAIL 1 | WARN 2 | SKIP 26 | PASS 38 ]
  Deleting unused snapshots:
  • app-server/001.json
  • app-server/002.json
  • app-server/003.json
  Error: Test failures
  Execution halted