-
Notifications
You must be signed in to change notification settings - Fork 755
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
Improve test coverage functionality #2537
Conversation
This was never used correctly because we're passing the path to the package root, instead of the test directory. Additionally, based on https://github.com/hadley/testcoverage, they don't actually appear to be needed. Fixes r-lib/testthat#1858
@jennybc could you please interactively kick the tires of this PR with https://github.com/hadley/testcoverage and convince yourself that it all works as expected? |
Yes, I feel like my tire-kicking of https://github.com/hadley/testcoverage has been successful. But as I've used
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I think all is well here and in testthat, (but suspect there may be some buglet in covr).
I made some other updates on |
🥳 Do you have a reprex for the recycling warning? I know I saw it multiple times in the workshop, but now I don't. |
I am also not seeing the |
This was never used correctly because we're passing the path to the package root, instead of the test directory. Additionally, based on https://github.com/hadley/testcoverage, they don't actually appear to be needed.
Fixes r-lib/testthat#1858
@jennybc my main scepticism here for the case of
test_coverage_active_file()
, I can't see how this can possibly work (even though it does). As far as I can tell, nothing intest_coverage_active_file()
causes eitherTESTTHAT_PKG
or the edition to be set correctly, but the tests still pass....
Ooooh maybe the problem is that
test_coverage_active_file()
never actually reveals when the test fails....
Yes, that was the problem, and once I fixed that, it revealed that the snapshot paths weren't set up correctly, and it helped me understand why
local_test_directory()
is needed here, and why it works. I've added comments so hopefully this is less of a journey in the future.