Running ‘testthat.R’ [34s/34s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(evaluator)
  > 
  > test_check("evaluator")
  ── 1. Error: Analyze report renders (@test-reports.R#28)  ─────────────────
  cannot open the connection
  1: evaluate_promise(generate_report(input_directory = tmpinputs, results_directory = tmpdata, 
         output_file = file, quiet = FALSE)) at testthat/test-reports.R:28
  2: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  3: force(code)
  4: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  5: withVisible(code)
  6: generate_report(input_directory = tmpinputs, results_directory = tmpdata, output_file = file, 
         quiet = FALSE)
  7: rmarkdown::render(system.file("rmd", "analyze_risk.Rmd", package = "evaluator"), 
         output_file = output_file, params = list(input_directory = input_directory, 
             results_directory = results_directory, focus_scenario_ids = focus_scenario_ids), 
         output_format = out_format, ...)
  8: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet, encoding = encoding)
  9: writeLines(if (encoding == "") res else native_encode(res, to = encoding), con = output, 
         useBytes = encoding != "")
  10: file(con, "w")
  
  ── 2. Error: Risk Dashboard renders (@test-reports.R#51)  ─────────────────
  cannot open the connection
  1: evaluate_promise(risk_dashboard(input_directory = tmpinputs, results_directory = tmpdata, 
         output_file = file, quiet = FALSE)) at testthat/test-reports.R:51
  2: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  3: force(code)
  4: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  5: withVisible(code)
  6: risk_dashboard(input_directory = tmpinputs, results_directory = tmpdata, output_file = file, 
         quiet = FALSE)
  7: rmarkdown::render(system.file("rmd", "risk_dashboard.Rmd", package = "evaluator"), 
         output_options = list(css = styles, favicon = icon, logo = icon), output_file = output_file, 
         params = list(input_directory = input_directory, results_directory = results_directory), 
         ...)
  8: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet, encoding = encoding)
  9: process_file(text, output)
  10: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group), 
         error = function(e) {
             setwd(wd)
             cat(res, sep = "\n", file = output %n% "")
             message("Quitting from lines ", paste(current_lines(i), collapse = "-"), 
                 " (", knit_concord$get("infile"), ") ")
         })
  ...
  13: call_block(x)
  14: block_exec(params)
  15: block_cache(options, output, objs)
  16: cache$library(options$cache.path, save = TRUE)
  17: writeLines(x, path)
  18: file(con, "w")
  19: .handleSimpleError(function (e) 
     {
         setwd(wd)
         cat(res, sep = "\n", file = output %n% "")
         message("Quitting from lines ", paste(current_lines(i), collapse = "-"), 
             " (", knit_concord$get("infile"), ") ")
     }, "cannot open the connection", quote(file(con, "w")))
  20: h(simpleError(msg, call))
  21: cat(res, sep = "\n", file = output %n% "")
  22: file(file, ifelse(append, "a", "w"))
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 78 SKIPPED: 3 FAILED: 2
  1. Error: Analyze report renders (@test-reports.R#28) 
  2. Error: Risk Dashboard renders (@test-reports.R#51) 
  
  Error: testthat unit tests failed
  Execution halted