Package coverage fails with uninformative error

I'm trying to add test coverage to a package (source code here). I'm getting the following error when running covr::package_coverage():

covr::package_coverage()
#> Error in vapply(x, function(xx) c(xx$srcref, xx$value), numeric(9), USE.NAMES = FALSE) : 
#>   values must be length 9,
#>  but FUN(X[[233]]) result is length 8

Unfortunately the error message doesn't tell me much about which part of my code is causing the problem. I'm using covr version 3.6.4.

For information, my tests use many callr subprocesses and temporary files (in case that makes it harder for covr to inspect the package).

Any help is welcome.

This often happens when a subprocess is killed, and it cannot write out the coverage data properly, resulting a broken RDS file, which makes covr error.

2 Likes

Is there anything I can do to prevent this? Can it be caused by a bug in my code? For example, the tests that use a subprocess fail when I explicitly import the functions to test with ::. It works in real life so I know there's a bug somewhere, can't determine where though.

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.