Running ‘testthat.R’ [14s/19s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(hardhat)
  > 
  > test_check("hardhat")
  [ FAIL 26 | WARN 1 | SKIP 0 | PASS 513 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test-forge-recipe.R:3:1): (code run outside of `test_that()`) ────────
  <packageNotFoundError/error/condition>
  Error in `library(recipes)`: there is no package called 'recipes'
  Backtrace:
      ▆
   1. └─base::library(recipes) at test-forge-recipe.R:3:0
  ── Error (test-mold-recipe.R:3:1): (code run outside of `test_that()`) ─────────
  <packageNotFoundError/error/condition>
  Error in `library(recipes)`: there is no package called 'recipes'
  Backtrace:
      ▆
   1. └─base::library(recipes) at test-mold-recipe.R:3:0
  ── Error (test-print.R:30:1): (code run outside of `test_that()`) ──────────────
  <packageNotFoundError/error/condition>
  Error in `library(recipes)`: there is no package called 'recipes'
  Backtrace:
      ▆
   1. └─base::library(recipes) at test-print.R:30:0
  ── Failure (test-use.R:11:3): can create a modeling package ────────────────────
  `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(...) at test-use.R:11:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat .capture(...)
    4. │   │ └─testthat::capture_output_lines(code, print, width = width)
    5. │   │   └─testthat:::eval_with_output(code, print = print, width = width)
    6. │   │     ├─withr::with_output_sink(path, withVisible(code))
    7. │   │     │ └─base::force(code)
    8. │   │     └─base::withVisible(code)
    9. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   10. ├─testthat::expect_error(...)
   11. │ └─testthat:::quasi_capture(...)
   12. │   ├─testthat .capture(...)
   13. │   │ └─base::withCallingHandlers(...)
   14. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   15. └─hardhat::create_modeling_package(dir_pkg, model, open = FALSE)
   16.   └─hardhat:::validate_installed("devtools")
   17.     └─rlang::abort(paste0("The `", pkg, "` package must be installed for this functionality."))
  ── Failure (test-use.R:11:3): can create a modeling package ────────────────────
  `expect_error(...)` produced no output
  ── Failure (test-use.R:21:3): can create a modeling package ────────────────────
  "DESCRIPTION" %in% top_level_files is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure (test-use.R:22:3): can create a modeling package ────────────────────
  "R" %in% top_level_files is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure (test-use.R:23:3): can create a modeling package ────────────────────
  "man" %in% top_level_files is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure (test-use.R:24:3): can create a modeling package ────────────────────
  "NAMESPACE" %in% top_level_files is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure (test-use.R:26:3): can create a modeling package ────────────────────
  glue::glue("{model}-constructor.R") %in% script_files is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure (test-use.R:27:3): can create a modeling package ────────────────────
  glue::glue("{model}-fit.R") %in% script_files is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure (test-use.R:28:3): can create a modeling package ────────────────────
  glue::glue("{model}-predict.R") %in% script_files is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure (test-use.R:40:3): can add a second model to a modeling package ─────
  `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(...) at test-use.R:40:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat .capture(...)
    4. │   │ └─testthat::capture_output_lines(code, print, width = width)
    5. │   │   └─testthat:::eval_with_output(code, print = print, width = width)
    6. │   │     ├─withr::with_output_sink(path, withVisible(code))
    7. │   │     │ └─base::force(code)
    8. │   │     └─base::withVisible(code)
    9. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   10. ├─testthat::expect_error(...)
   11. │ └─testthat:::quasi_capture(...)
   12. │   ├─testthat .capture(...)
   13. │   │ └─base::withCallingHandlers(...)
   14. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   15. └─hardhat::create_modeling_package(dir_pkg, model1, open = FALSE)
   16.   └─hardhat:::validate_installed("devtools")
   17.     └─rlang::abort(paste0("The `", pkg, "` package must be installed for this functionality."))
  ── Failure (test-use.R:40:3): can add a second model to a modeling package ─────
  `expect_error(...)` produced no output
  ── Failure (test-use.R:53:3): can add a second model to a modeling package ─────
  `with_dir(dir_pkg, use_modeling_files(model2))` threw an error.
  Message: Path '/home/hornik/tmp/scratch/Rtmp4560xT/model/' does not appear to be inside a project or package.
  Class:   usethis_error/error/condition
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-use.R:53:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. ├─hardhat with_dir(dir_pkg, use_modeling_files(model2))
    7. │ └─base::force(code) at test-use.R:50:4
    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()")
   12. │       ├─usethis::ui_stop(message)
   13. │       │ └─glue::glue(x, .envir = .envir)
   14. │       │   └─glue::glue_data(...)
   15. │       ├─usethis::ui_value(project_name())
   16. │       └─usethis:::project_name()
   17. │         ├─fs::path_file(base_path)
   18. │         └─usethis::proj_get()
   19. │           └─usethis::proj_set(".")
   20. │             └─usethis::ui_stop("Path {ui_path(path)} does not appear to be inside a project or package.")
   21. └─glue `<fn>`("ui_value(project_name())")
   22.   ├─.transformer(expr, env) %||% .null
   23.   └─glue .transformer(expr, env)
   24.     └─base::eval(parse(text = text, keep.source = FALSE), envir)
   25.       └─base::eval(parse(text = text, keep.source = FALSE), envir)
  ── Failure (test-use.R:60:3): can add a second model to a modeling package ─────
  glue::glue("{model1}-constructor.R") %in% script_files is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure (test-use.R:61:3): can add a second model to a modeling package ─────
  glue::glue("{model1}-fit.R") %in% script_files is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure (test-use.R:62:3): can add a second model to a modeling package ─────
  glue::glue("{model1}-predict.R") %in% script_files is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure (test-use.R:64:3): can add a second model to a modeling package ─────
  glue::glue("{model2}-constructor.R") %in% script_files is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure (test-use.R:65:3): can add a second model to a modeling package ─────
  glue::glue("{model2}-fit.R") %in% script_files is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure (test-use.R:66:3): can add a second model to a modeling package ─────
  glue::glue("{model2}-predict.R") %in% script_files is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure (test-use.R:70:3): no `model` aborts early ──────────────────────────
  `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") at test-use.R:70:2
   2. │ └─testthat:::quasi_capture(...)
   3. │   ├─testthat .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. └─hardhat::create_modeling_package("my/path")
   7.   └─hardhat:::validate_installed("devtools")
   8.     └─rlang::abort(paste0("The `", pkg, "` package must be installed for this functionality."))
  ── Failure (test-use.R:77:3): no `path` aborts normally ────────────────────────
  `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(...) at test-use.R:77:2
   2. │ └─testthat:::quasi_capture(...)
   3. │   ├─testthat .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. └─hardhat::create_modeling_package(model = "my_model")
   7.   └─hardhat:::validate_installed("devtools")
   8.     └─rlang::abort(paste0("The `", pkg, "` package must be installed for this functionality."))
  ── Failure (test-use.R:84:3): `model` can only be a single string ──────────────
  `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(...) at test-use.R:84:2
   2. │ └─testthat:::quasi_capture(...)
   3. │   ├─testthat .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. └─hardhat::create_modeling_package(model = c("model1", "model2"))
   7.   └─hardhat:::validate_installed("devtools")
   8.     └─rlang::abort(paste0("The `", pkg, "` package must be installed for this functionality."))
  ── Failure (test-use.R:89:3): `model` can only be a single string ──────────────
  `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") at test-use.R:89:2
   2. │ └─testthat:::quasi_capture(...)
   3. │   ├─testthat .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. └─hardhat::create_modeling_package(model = 1)
   7.   └─hardhat:::validate_installed("devtools")
   8.     └─rlang::abort(paste0("The `", pkg, "` package must be installed for this functionality."))
  ── Failure (test-use.R:94:3): `model` can only be a single string ──────────────
  `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(...) at test-use.R:94:2
   2. │ └─testthat:::quasi_capture(...)
   3. │   ├─testthat .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. └─hardhat::create_modeling_package(model = "model with space")
   7.   └─hardhat:::validate_installed("devtools")
   8.     └─rlang::abort(paste0("The `", pkg, "` package must be installed for this functionality."))
  
  [ FAIL 26 | WARN 1 | SKIP 0 | PASS 513 ]
  Error: Test failures
  Execution halted