`covr::report()` appears to hang indefinitely

Evening folks,

Trying to set up unit testing on an old package that has thusfar never had any (GitHub - openair-project/openair: 🧭 Open source tools for air quality data analysis).

devtools::test() runs perfectly fine, but covr::report() and covr::package_coverage() both appear to run indefinitely without generating a report.

I have tried to run covr::report() with quiet = FALSE and with a path set so I can see what is created when the package is buit, but I'm not sure what to look for to work out what is going amiss. I note an openair-commands.Rout.fail file is created, but that just has the R startup message and library(openair) in it.

I do wonder if it has something to do with the C code in src.

Note that the issue should be nothing to do with the tests themselves, as I've just got the default "multiplication works" test in there at the mo.

The addition of unit tests is part of a wider modernisation effort for quite an old package, so it's possible something in here isn't set up properly to appease covr.

1 Like

In my experience covr::report() can be very slow if you have a lot of source files. I am not sure if there is a solution to this.

1 Like

You are entirely right - I decided to be a bit more patient and it did indeed resolve itself after 7 minutes!

If there's no easy way to make it faster I'll just have to put up with it.

Thanks again.

One thing you can try is to ignore the .c and/or .h files that you are not interested in. I am not entirely sure that covr will not scan them, but I think there is a chance. See the covr docs on how to ignore files.

This topic was automatically closed 7 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.