-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect package coverage #438
Comments
There is an open issue about coverage for shiny applications (#277) I would generally not expect it to work out of the box currently. If you want to try and investigate it further you can use |
I have a similar problem on ropensci/rtweet, which doesn't use shiny. The local report doesn't increase the coverage of some functions that I have just added test for them (using R 3.6.3/4.0.1, testthat 3.0, RStudio 1.4.1103), but on the github action the report is much higher than on the local computer. Tried installing the package and covr::report it again, but didn't solve the issue. |
The same problem seems to be happening in shiny.reglog. Tests are written using Interestingly, introducing |
@jimhester Do you happen to know how to read trace files retained with |
Yes, covr writes the trace files on an on.exit handler, so R needs to be given time to quit rather than being issued a sigkill. In https://github.com/rstudio/shinytest2/blob/08c4060609d5ee9b52278521a08cbf4e0593ffb4/R/app-driver-stop.R#L30-L34 it seems there is a brief wait, but likely it is not long enough. You really need to avoid |
I use
covr::package_coverage()
to get the coverage of this package. Everything worked properly, the coverage was ~88% and the output was correct:I added some new unit tests in
test-integration2.R
file and the coverage dropped to ~14% with a weird output:Once in a while (I could not find stable reproduction steps) it says:
And this output looks like it should, but it's a rare result. Any suggestions what may be the reason? It's definitely something in
test-integration2.R
, because when I disable this file the coverage is ~88% again.The text was updated successfully, but these errors were encountered: