evalthat provides a number of custom testthat testthat::Reporters. These reporters process the results from test files, generating interactive summaries and saving results to persistent files.
EvalProgressReporter
is designed for interactive use. Its goal is to
give you actionable insights to help you understand the status of your
code. This reporter also praises you from time-to-time if all your tests
pass. It's the default reporter for test_dir()
.
EvalCompactProgressReporter
is a minimal version of EvalProgressReporter
designed for use with single files. It's the default reporter for
test_file()
.
Super classes
testthat::Reporter
-> testthat::ProgressReporter
-> EvalProgressReporter
Public fields
show_praise
Whether to show praise. Will not be shown, even if
TRUE
.res_ok, res_skip, res_warn, res_fail
The same as fields prefixed with
n_*
in the superclass, but encoded a vector whose sum can be taken to find then_*
values. Enables weights per-expectation.ctxt_res_ok, ctxt_res_skip, ctxt_res_warn, ctxt_res_fail, ctxt_issues, ctxt_n
The same as those without the
ctxt_*
prefix, but per-context.io
Active bindings
res_ok, res_skip, res_warn, res_fail
The same as fields prefixed with
n_*
in the superclass, but encoded a vector whose sum can be taken to find then_*
values. Enables weights per-expectation.ctxt_res_ok, ctxt_res_skip, ctxt_res_warn, ctxt_res_fail, ctxt_issues, ctxt_n
The same as those without the
ctxt_*
prefix, but per-context.
Methods
Inherited methods
testthat::Reporter$.start_context()
testthat::Reporter$cat_line()
testthat::Reporter$cat_tight()
testthat::Reporter$end_context_if_started()
testthat::Reporter$end_test()
testthat::Reporter$local_user_output()
testthat::Reporter$rule()
testthat::Reporter$start_test()
testthat::Reporter$update()
testthat::ProgressReporter$cr()
testthat::ProgressReporter$initialize()
testthat::ProgressReporter$report_issues()
testthat::ProgressReporter$should_update()
testthat::ProgressReporter$status_data()
Method is_full()
Method overwritting to always return FALSE
, as failed evals are not
a reason to stop testing in our context.
Method update_io()
Concatenated inputs and outputs flagged with input()
and output()
.
Concatenate inputs and outputs flagged with input()
and output()
.
Method update_counts()
Eval reporters' n_*
fields are actually tracked by
maintaining vectors of 1s prefixed with res_*
. This is to accommodate
a future extension where weights can be assigned to each pass/fail.
This function updates the n_*
values based on the res_*
values.
Method reset_counts()
Sets the values of res_*
fields to numeric()
and calls
update_counts()
.
Method save_results()
Situates the evaluation results in a tibble and saves it to the
file eval_file_name/timestamp.rds
using qs::qread()
. Read individual
results with qs::qsave()
.
Situate evaluation results in a tibble.
Method end_file()
Overrides the superclass' method to end the context when the file ends since files are reran when running evals.
Super classes
testthat::Reporter
-> testthat::ProgressReporter
-> evalthat::EvalProgressReporter
-> EvalCompactProgressReporter
Methods
Inherited methods
testthat::Reporter$.start_context()
testthat::Reporter$cat_line()
testthat::Reporter$cat_tight()
testthat::Reporter$end_context_if_started()
testthat::Reporter$end_test()
testthat::Reporter$local_user_output()
testthat::Reporter$rule()
testthat::Reporter$start_test()
testthat::Reporter$update()
testthat::ProgressReporter$cr()
testthat::ProgressReporter$report_issues()
testthat::ProgressReporter$should_update()
testthat::ProgressReporter$status_data()
evalthat::EvalProgressReporter$add_result()
evalthat::EvalProgressReporter$cache_for_grading()
evalthat::EvalProgressReporter$end_context()
evalthat::EvalProgressReporter$end_file()
evalthat::EvalProgressReporter$is_full()
evalthat::EvalProgressReporter$reset_counts()
evalthat::EvalProgressReporter$result_summary()
evalthat::EvalProgressReporter$save_results()
evalthat::EvalProgressReporter$show_header()
evalthat::EvalProgressReporter$start_context()
evalthat::EvalProgressReporter$update_counts()
evalthat::EvalProgressReporter$update_io()
Method new()
Sets minimum time to infinity.
Usage
EvalCompactProgressReporter$new(min_time = Inf, ...)