Running ‘testthat.R’ [100s/109s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(evaluator)
  > 
  > test_check("evaluator")
  ── 1. Error: Domain summary (@test-summarize.R#21)  ────────────────────────────
  Column `ale` not found in `.data`
  1: expect_equivalent(summarize_domains(simulation_results), domain_summary) at testthat/test-summarize.R:21
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: summarize_domains(simulation_results)
  5: simulation_results %>% group_by(.data$domain_id, .data$simulation) %>% dplyr::mutate(avoided_events = .data$threat_events - 
         .data$loss_events) %>% dplyr::summarize(ale_sum = sum(.data$ale), loss_events = sum(.data$loss_events, 
         na.rm = TRUE), threat_events = sum(.data$threat_events, na.rm = TRUE), avoided_events = sum(.data$avoided_events, 
         na.rm = TRUE), loss_events = sum(.data$loss_events, na.rm = TRUE), mean_tc_exceedance = (sum(.data$mean_tc_exceedance * 
         .data$loss_events, na.rm = TRUE)/sum(.data$loss_events, na.rm = TRUE)) %>% ifelse(is.finite(.), 
         ., 0), mean_diff_exceedance = (sum(.data$mean_diff_exceedance * (.data$threat_events - 
         .data$loss_events), na.rm = TRUE)/sum(.data$threat_events - .data$loss_events, 
         na.rm = TRUE)) %>% ifelse(is.finite(.), ., 0)) %>% dplyr::summarize(ale_min = min(.data$ale_sum, 
         na.rm = TRUE), ale_median = median(.data$ale_sum, na.rm = TRUE), ale_mean = mean(.data$ale_sum, 
         na.rm = TRUE), ale_max = max(.data$ale_sum, na.rm = TRUE), ale_sd = stats::sd(.data$ale_sum, 
         na.rm = TRUE), ale_var = stats::quantile(.data$ale_sum, probs = 0.95, na.rm = TRUE), 
         mean_threat_events = mean(.data$threat_events, na.rm = TRUE), mean_loss_events = mean(.data$loss_events, 
             na.rm = TRUE), mean_avoided_events = mean(.data$avoided_events, na.rm = TRUE), 
         mean_tc_exceedance = (sum(.data$mean_tc_exceedance * .data$loss_events, na.rm = TRUE)/sum(.data$loss_events, 
             na.rm = TRUE)) %>% ifelse(is.finite(.), ., 0), mean_diff_exceedance = (sum(.data$mean_diff_exceedance * 
             (.data$threat_events - .data$loss_events), na.rm = TRUE)/sum(.data$threat_events - 
             .data$loss_events, na.rm = TRUE)) %>% ifelse(is.finite(.), ., 0), mean_vuln = (.data$mean_loss_events/.data$mean_threat_events)) %>% 
         dplyr::select(.data$domain_id, .data$ale, dplyr::everything())
  6: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: eval(quote(`_fseq`(`_lhs`)), env, env)
  9: `_fseq`(`_lhs`)
  10: freduce(value, `_function_list`)
  ...
  13: dplyr::select(., .data$domain_id, .data$ale, dplyr::everything())
  14: select.data.frame(., .data$domain_id, .data$ale, dplyr::everything())
  15: tidyselect::vars_select(names(.data), !!!quos(...))
  16: vars_select_eval(.vars, quos)
  17: map_if(quos, !is_helper, eval_tidy, mask)
  18: map(.x[sel], .f, ...)
  19: .f(.x[[i]], ...)
  20: .data$ale
  21: `$.rlang_data_pronoun`(.data, ale)
  22: abort(sprintf(.subset2(x, "lookup_msg"), name), "rlang_data_pronoun_not_found")
  
  ── 2. Error: Summarize to disk (@test-summarize.R#28)  ─────────────────────────
  Column `ale` not found in `.data`
  1: summarize_to_disk(evaluator::simulation_results, evaluator::domains, results_dir = tmpdata) at testthat/test-summarize.R:28
  2: summarize_domains(simulation_results)
  3: simulation_results %>% group_by(.data$domain_id, .data$simulation) %>% dplyr::mutate(avoided_events = .data$threat_events - 
         .data$loss_events) %>% dplyr::summarize(ale_sum = sum(.data$ale), loss_events = sum(.data$loss_events, 
         na.rm = TRUE), threat_events = sum(.data$threat_events, na.rm = TRUE), avoided_events = sum(.data$avoided_events, 
         na.rm = TRUE), loss_events = sum(.data$loss_events, na.rm = TRUE), mean_tc_exceedance = (sum(.data$mean_tc_exceedance * 
         .data$loss_events, na.rm = TRUE)/sum(.data$loss_events, na.rm = TRUE)) %>% ifelse(is.finite(.), 
         ., 0), mean_diff_exceedance = (sum(.data$mean_diff_exceedance * (.data$threat_events - 
         .data$loss_events), na.rm = TRUE)/sum(.data$threat_events - .data$loss_events, 
         na.rm = TRUE)) %>% ifelse(is.finite(.), ., 0)) %>% dplyr::summarize(ale_min = min(.data$ale_sum, 
         na.rm = TRUE), ale_median = median(.data$ale_sum, na.rm = TRUE), ale_mean = mean(.data$ale_sum, 
         na.rm = TRUE), ale_max = max(.data$ale_sum, na.rm = TRUE), ale_sd = stats::sd(.data$ale_sum, 
         na.rm = TRUE), ale_var = stats::quantile(.data$ale_sum, probs = 0.95, na.rm = TRUE), 
         mean_threat_events = mean(.data$threat_events, na.rm = TRUE), mean_loss_events = mean(.data$loss_events, 
             na.rm = TRUE), mean_avoided_events = mean(.data$avoided_events, na.rm = TRUE), 
         mean_tc_exceedance = (sum(.data$mean_tc_exceedance * .data$loss_events, na.rm = TRUE)/sum(.data$loss_events, 
             na.rm = TRUE)) %>% ifelse(is.finite(.), ., 0), mean_diff_exceedance = (sum(.data$mean_diff_exceedance * 
             (.data$threat_events - .data$loss_events), na.rm = TRUE)/sum(.data$threat_events - 
             .data$loss_events, na.rm = TRUE)) %>% ifelse(is.finite(.), ., 0), mean_vuln = (.data$mean_loss_events/.data$mean_threat_events)) %>% 
         dplyr::select(.data$domain_id, .data$ale, dplyr::everything())
  4: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  5: eval(quote(`_fseq`(`_lhs`)), env, env)
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: `_fseq`(`_lhs`)
  8: freduce(value, `_function_list`)
  9: withVisible(function_list[[k]](value))
  10: function_list[[k]](value)
  11: dplyr::select(., .data$domain_id, .data$ale, dplyr::everything())
  12: select.data.frame(., .data$domain_id, .data$ale, dplyr::everything())
  13: tidyselect::vars_select(names(.data), !!!quos(...))
  14: vars_select_eval(.vars, quos)
  15: map_if(quos, !is_helper, eval_tidy, mask)
  16: map(.x[sel], .f, ...)
  17: .f(.x[[i]], ...)
  18: .data$ale
  19: `$.rlang_data_pronoun`(.data, ale)
  20: abort(sprintf(.subset2(x, "lookup_msg"), name), "rlang_data_pronoun_not_found")
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 85 SKIPPED: 5 FAILED: 2
  1. Error: Domain summary (@test-summarize.R#21) 
  2. Error: Summarize to disk (@test-summarize.R#28) 
  
  Error: testthat unit tests failed
  Execution halted