Running ‘testthat.R’ [30s/47s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(hardhat)
  > 
  > test_check("hardhat")
  ── 1. Failure: novel levels are handled correctly when the new column is a chara
  `forge(new, x$blueprint)` threw an error with unexpected class.
  Expected class: vctrs_error_cast_lossy
  Actual class:   packageNotFoundError/error/condition
  Message:        there is no package called 'digest'
  Backtrace:
    1. testthat::expect_error(forge(new, x$blueprint), class = "vctrs_error_cast_lossy")
    7. hardhat:::forge.data.frame(new, x$blueprint)
    8. blueprint$forge$clean(...)
    9. hardhat::scream(predictors, blueprint$ptypes$predictors, allow_novel_levels = blueprint$allow_novel_levels)
   10. vctrs::vec_cast(data, ptype)
   12. vctrs:::vec_cast.ordered.character(...)
   13. vctrs:::ord_cast(x, to, ...)
   14. vctrs:::fct_cast_impl(...)
   15. vctrs::maybe_lossy_cast(...)
   19. vctrs:::stop_lossy_cast(...)
       ...
   41. vctrs:::vec_ptype_full.ordered(cnd$to)
   43. vctrs:::hash_label(levels(x))
   45. digest::digest
   46. base::getExportedValue(pkg, name)
   47. base::asNamespace(ns)
   48. base::getNamespace(ns)
   49. base::loadNamespace(name)
   50. base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   51. base:::withOneRestart(expr, restarts[[1L]])
   52. base:::doWithOneRestart(return(expr), restart)
  
  ── 2. Failure: novel ordered factor predictor levels are never allowed (@test-fo
  `forge(new, x1$blueprint)` threw an error with unexpected class.
  Expected class: vctrs_error_incompatible_type
  Actual class:   packageNotFoundError/error/condition
  Message:        there is no package called 'digest'
  Backtrace:
    1. testthat::expect_error(forge(new, x1$blueprint), class = "vctrs_error_incompatible_type")
   11. vctrs::stop_incompatible_type(...)
   12. vctrs:::cnd_type_message(...)
   13. vctrs:::cnd_type_message_type_label(x)
   15. vctrs:::vec_ptype_full.ordered(x)
   17. vctrs:::hash_label(levels(x))
   19. digest::digest
   20. base::getExportedValue(pkg, name)
   21. base::asNamespace(ns)
   22. base::getNamespace(ns)
   23. base::loadNamespace(name)
   24. base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   25. base:::withOneRestart(expr, restarts[[1L]])
   26. base:::doWithOneRestart(return(expr), restart)
  
  ── 3. Failure: novel ordered factor predictor levels are never allowed (@test-fo
  `forge(new, x2$blueprint)` threw an error with unexpected class.
  Expected class: vctrs_error_incompatible_type
  Actual class:   packageNotFoundError/error/condition
  Message:        there is no package called 'digest'
  Backtrace:
    1. testthat::expect_error(forge(new, x2$blueprint), class = "vctrs_error_incompatible_type")
   11. vctrs::stop_incompatible_type(...)
   12. vctrs:::cnd_type_message(...)
   13. vctrs:::cnd_type_message_type_label(x)
   15. vctrs:::vec_ptype_full.ordered(x)
   17. vctrs:::hash_label(levels(x))
   19. digest::digest
   20. base::getExportedValue(pkg, name)
   21. base::asNamespace(ns)
   22. base::getNamespace(ns)
   23. base::loadNamespace(name)
   24. base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   25. base:::withOneRestart(expr, restarts[[1L]])
   26. base:::doWithOneRestart(return(expr), restart)
  
  ── 4. Failure: ordered factor predictors with different level ordering is an err
  `forge(new, x1$blueprint)` threw an error with unexpected class.
  Expected class: vctrs_error_incompatible_type
  Actual class:   packageNotFoundError/error/condition
  Message:        there is no package called 'digest'
  Backtrace:
    1. testthat::expect_error(forge(new, x1$blueprint), class = "vctrs_error_incompatible_type")
   11. vctrs::stop_incompatible_type(...)
   12. vctrs:::cnd_type_message(...)
   13. vctrs:::cnd_type_message_type_label(x)
   15. vctrs:::vec_ptype_full.ordered(x)
   17. vctrs:::hash_label(levels(x))
   19. digest::digest
   20. base::getExportedValue(pkg, name)
   21. base::asNamespace(ns)
   22. base::getNamespace(ns)
   23. base::loadNamespace(name)
   24. base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   25. base:::withOneRestart(expr, restarts[[1L]])
   26. base:::doWithOneRestart(return(expr), restart)
  
  ── 5. Failure: ordered factor predictors with different level ordering is an err
  `forge(new, x2$blueprint)` threw an error with unexpected class.
  Expected class: vctrs_error_incompatible_type
  Actual class:   packageNotFoundError/error/condition
  Message:        there is no package called 'digest'
  Backtrace:
    1. testthat::expect_error(forge(new, x2$blueprint), class = "vctrs_error_incompatible_type")
   11. vctrs::stop_incompatible_type(...)
   12. vctrs:::cnd_type_message(...)
   13. vctrs:::cnd_type_message_type_label(x)
   15. vctrs:::vec_ptype_full.ordered(x)
   17. vctrs:::hash_label(levels(x))
   19. digest::digest
   20. base::getExportedValue(pkg, name)
   21. base::asNamespace(ns)
   22. base::getNamespace(ns)
   23. base::loadNamespace(name)
   24. base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   25. base:::withOneRestart(expr, restarts[[1L]])
   26. base:::doWithOneRestart(return(expr), restart)
  
  ── 6. Failure: missing ordered factor levels are an error (@test-forge-formula.R
  `forge(new, x1$blueprint)` threw an error with unexpected class.
  Expected class: vctrs_error_incompatible_type
  Actual class:   packageNotFoundError/error/condition
  Message:        there is no package called 'digest'
  Backtrace:
    1. testthat::expect_error(forge(new, x1$blueprint), class = "vctrs_error_incompatible_type")
   11. vctrs::stop_incompatible_type(...)
   12. vctrs:::cnd_type_message(...)
   13. vctrs:::cnd_type_message_type_label(x)
   15. vctrs:::vec_ptype_full.ordered(x)
   17. vctrs:::hash_label(levels(x))
   19. digest::digest
   20. base::getExportedValue(pkg, name)
   21. base::asNamespace(ns)
   22. base::getNamespace(ns)
   23. base::loadNamespace(name)
   24. base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   25. base:::withOneRestart(expr, restarts[[1L]])
   26. base:::doWithOneRestart(return(expr), restart)
  
  ── 7. Failure: missing ordered factor levels are an error (@test-forge-formula.R
  `forge(new, x2$blueprint)` threw an error with unexpected class.
  Expected class: vctrs_error_incompatible_type
  Actual class:   packageNotFoundError/error/condition
  Message:        there is no package called 'digest'
  Backtrace:
    1. testthat::expect_error(forge(new, x2$blueprint), class = "vctrs_error_incompatible_type")
   11. vctrs::stop_incompatible_type(...)
   12. vctrs:::cnd_type_message(...)
   13. vctrs:::cnd_type_message_type_label(x)
   15. vctrs:::vec_ptype_full.ordered(x)
   17. vctrs:::hash_label(levels(x))
   19. digest::digest
   20. base::getExportedValue(pkg, name)
   21. base::asNamespace(ns)
   22. base::getNamespace(ns)
   23. base::loadNamespace(name)
   24. base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   25. base:::withOneRestart(expr, restarts[[1L]])
   26. base:::doWithOneRestart(return(expr), restart)
  
  ── 8. Failure: ignoring novel levels still passes through incompatible classes (
  `scream(new, ptype, allow_novel_levels = TRUE)` threw an error with unexpected class.
  Expected class: vctrs_error_incompatible_type
  Actual class:   packageNotFoundError/error/condition
  Message:        there is no package called 'digest'
  Backtrace:
    1. testthat::expect_error(...)
    6. hardhat::scream(new, ptype, allow_novel_levels = TRUE)
    7. vctrs::vec_cast(data, ptype)
    9. vctrs::vec_default_cast(...)
   10. vctrs::stop_incompatible_cast(...)
   11. vctrs::stop_incompatible_type(...)
   12. vctrs:::cnd_type_message(...)
   13. vctrs:::cnd_type_message_type_label(y)
   15. vctrs:::vec_ptype_full.factor(x)
   17. vctrs:::hash_label(levels(x))
   19. digest::digest
   20. base::getExportedValue(pkg, name)
   21. base::asNamespace(ns)
   22. base::getNamespace(ns)
   23. base::loadNamespace(name)
   24. base::withRestarts(stop(cond), retry_loadNamespace = function() NULL)
   25. base:::withOneRestart(expr, restarts[[1L]])
   26. base:::doWithOneRestart(return(expr), restart)
  
  ── 9. Failure: can create a modeling package (@test-use.R#11)  ─────────────────
  `create_modeling_package(dir_pkg, model, open = FALSE)` threw an error.
  Message: The `devtools` package must be installed for this functionality.
  Class:   rlang_error/error/condition
  Backtrace:
    1. testthat::expect_output(...)
   15. hardhat::create_modeling_package(dir_pkg, model, open = FALSE)
   16. hardhat:::validate_installed("devtools")
  
  ── 10. Failure: can create a modeling package (@test-use.R#11)  ────────────────
  `expect_error(...)` produced no output
  
  ── 11. Failure: can create a modeling package (@test-use.R#21)  ────────────────
  "DESCRIPTION" %in% top_level_files isn't true.
  
  ── 12. Failure: can create a modeling package (@test-use.R#22)  ────────────────
  "R" %in% top_level_files isn't true.
  
  ── 13. Failure: can create a modeling package (@test-use.R#23)  ────────────────
  "man" %in% top_level_files isn't true.
  
  ── 14. Failure: can create a modeling package (@test-use.R#24)  ────────────────
  "NAMESPACE" %in% top_level_files isn't true.
  
  ── 15. Failure: can create a modeling package (@test-use.R#26)  ────────────────
  glue::glue("{model}-constructor.R") %in% script_files isn't true.
  
  ── 16. Failure: can create a modeling package (@test-use.R#27)  ────────────────
  glue::glue("{model}-fit.R") %in% script_files isn't true.
  
  ── 17. Failure: can create a modeling package (@test-use.R#28)  ────────────────
  glue::glue("{model}-predict.R") %in% script_files isn't true.
  
  ── 18. Failure: can add a second model to a modeling package (@test-use.R#40)  ─
  `create_modeling_package(dir_pkg, model1, open = FALSE)` threw an error.
  Message: The `devtools` package must be installed for this functionality.
  Class:   rlang_error/error/condition
  Backtrace:
    1. testthat::expect_output(...)
   15. hardhat::create_modeling_package(dir_pkg, model1, open = FALSE)
   16. hardhat:::validate_installed("devtools")
  
  ── 19. Failure: can add a second model to a modeling package (@test-use.R#40)  ─
  `expect_error(...)` produced no output
  
  ── 20. Failure: can add a second model to a modeling package (@test-use.R#53)  ─
  `with_dir(dir_pkg, use_modeling_files(model2))` threw an error.
  Message: Path '/tmp/RtmpkLaaKI/working_dir/Rtmp7LayBY/model/' does not appear to be inside a project or package.
  Class:   usethis_error/error/condition
  Backtrace:
    1. testthat::expect_error(...)
    8. hardhat::use_modeling_files(model2)
    9. hardhat:::use_modeling_files_impl(model)
   10. usethis::use_package_doc()
   11. usethis:::check_is_package("use_package_doc()")
   20. usethis:::project_name()
   22. usethis::proj_get()
   23. usethis::proj_set(".")
   24. usethis::ui_stop("Path {ui_path(path)} does not appear to be inside a project or package.")
  
  ── 21. Failure: can add a second model to a modeling package (@test-use.R#60)  ─
  glue::glue("{model1}-constructor.R") %in% script_files isn't true.
  
  ── 22. Failure: can add a second model to a modeling package (@test-use.R#61)  ─
  glue::glue("{model1}-fit.R") %in% script_files isn't true.
  
  ── 23. Failure: can add a second model to a modeling package (@test-use.R#62)  ─
  glue::glue("{model1}-predict.R") %in% script_files isn't true.
  
  ── 24. Failure: can add a second model to a modeling package (@test-use.R#64)  ─
  glue::glue("{model2}-constructor.R") %in% script_files isn't true.
  
  ── 25. Failure: can add a second model to a modeling package (@test-use.R#65)  ─
  glue::glue("{model2}-fit.R") %in% script_files isn't true.
  
  ── 26. Failure: can add a second model to a modeling package (@test-use.R#66)  ─
  glue::glue("{model2}-predict.R") %in% script_files isn't true.
  
  ── 27. Failure: no `model` aborts early (@test-use.R#70)  ──────────────────────
  `create_modeling_package("my/path")` threw an error with unexpected message.
  Expected match: "is missing, with no default"
  Actual message: "The `devtools` package must be installed for this functionality."
  Backtrace:
   1. testthat::expect_error(create_modeling_package("my/path"), "is missing, with no default")
   6. hardhat::create_modeling_package("my/path")
   7. hardhat:::validate_installed("devtools")
  
  ── 28. Failure: no `path` aborts normally (@test-use.R#77)  ────────────────────
  `create_modeling_package(model = "my_model")` threw an error with unexpected message.
  Expected match: "is missing, with no default"
  Actual message: "The `devtools` package must be installed for this functionality."
  Backtrace:
   1. testthat::expect_error(...)
   6. hardhat::create_modeling_package(model = "my_model")
   7. hardhat:::validate_installed("devtools")
  
  ── 29. Failure: `model` can only be a single string (@test-use.R#84)  ──────────
  `create_modeling_package(model = c("model1", "model2"))` threw an error with unexpected message.
  Expected match: "must be a single string"
  Actual message: "The `devtools` package must be installed for this functionality."
  Backtrace:
   1. testthat::expect_error(...)
   6. hardhat::create_modeling_package(model = c("model1", "model2"))
   7. hardhat:::validate_installed("devtools")
  
  ── 30. Failure: `model` can only be a single string (@test-use.R#89)  ──────────
  `create_modeling_package(model = 1)` threw an error with unexpected message.
  Expected match: "must be a single string"
  Actual message: "The `devtools` package must be installed for this functionality."
  Backtrace:
   1. testthat::expect_error(create_modeling_package(model = 1), "must be a single string")
   6. hardhat::create_modeling_package(model = 1)
   7. hardhat:::validate_installed("devtools")
  
  ── 31. Failure: `model` can only be a single string (@test-use.R#94)  ──────────
  `create_modeling_package(model = "model with space")` threw an error with unexpected message.
  Expected match: "must not contain any spaces"
  Actual message: "The `devtools` package must be installed for this functionality."
  Backtrace:
   1. testthat::expect_error(...)
   6. hardhat::create_modeling_package(model = "model with space")
   7. hardhat:::validate_installed("devtools")
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 409 | SKIPPED: 0 | WARNINGS: 2 | FAILED: 31 ]
  1. Failure: novel levels are handled correctly when the new column is a character and the original is ordered (@test-forge-formula.R#323) 
  2. Failure: novel ordered factor predictor levels are never allowed (@test-forge-formula.R#394) 
  3. Failure: novel ordered factor predictor levels are never allowed (@test-forge-formula.R#398) 
  4. Failure: ordered factor predictors with different level ordering is an error (@test-forge-formula.R#421) 
  5. Failure: ordered factor predictors with different level ordering is an error (@test-forge-formula.R#425) 
  6. Failure: missing ordered factor levels are an error (@test-forge-formula.R#541) 
  7. Failure: missing ordered factor levels are an error (@test-forge-formula.R#545) 
  8. Failure: ignoring novel levels still passes through incompatible classes (@test-scream.R#50) 
  9. Failure: can create a modeling package (@test-use.R#11) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted