testthat output for warnings and errors

I'm developing a custom package and testthat/RStudio returns so much output from certain warnings and errors when I run tests that I can't even scroll to the top of the test output. This happens in the console and the Build window. It also happens when I run Check.

The issue is concentrated around code that uses library(furrr). When I run the code interactively, I get a modest message:

> synth <- synthesize(presynth)
Error in (function (.l, .f, ..., .progress = FALSE)  : 
  ℹ In index: 1.
Caused by error in `add_noise_kde()`:
! unused argument (alist())

I get a few hundred lines of output for each error/warning when I run devtools::test() or devtools::test_local(). I experimented with reporters but that ends up being a blunt force fix. I just want to understand how to minimize error and warning output in the default framework.

Well, that seems like an error in the package, so a different reporter is not going to fix that.

Obviously there is an error and I included it as an example. But the reporter returns so much output that I can't even scroll through to see which tests fail. I've been working around this for months but I want to find a better way.

Maybe I am missing something, but you don't need testthat to detect and fix errors that are not test failures. Run a small piece of code without testthat.

Perhaps your issue is the length of console output? then maybe something like sink()-ing the output to a file where its readable as txt? if the sole issue is ability to scroll around the results ...

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.