How are folks managing results from testthat?
Tests can sometimes take a long time to run, and I want to cache/store the results of the tests somewhere.
This feels like the sort of ergonomics that usethis would help smooth over.
It sounds like the functionality is already there, when I asked at Helper to extract summary of previously run tests? · Issue #1494 · r-lib/testthat · GitHub
It sounds like there are options with
option(testthat.output_file)
It also sounds like there are ways to manage this with custom Reporters/Multireporters
But reading Manage test reporting — Reporter • testthat this feels a bit beyond me.
What I want is:
- A function to easily capture the test output
- Ways to extract out key test files that are failing
- Ways to extract out key test files that are warning
- Extract out notes
The functionality I am imagining is something like
write_tests_to("file/path")
# or
turn_on_test_logging()
# provides informative message about how to access test results
devtools::test()
# results are in console or Build tab in RStudio
test_results <- extract_test_results("file/path")
# notes, warnings, errors are stored as data
test_results$note
test_results$warning
test_results$error
# summary/top of note/warning/error are stored in summary list
test_results$summary$note
test_results$summary$warning
test_results$summary$error
This has the feeling of something that already exists, but does it?
I'm just finding it a bit tricky to spend 5-10 minutes running tests locally, fixing something, then trying to remember what the other remaining things were that needed fixing - sometimes 10 minutes ago, sometimes as of a certain date. I know that Github CI could help with this, but sometimes I need to solve things locally first as GH runners create tricky issues with installation/sometimes just don't work.
Any thoughts, much appreciated!