You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
devtools::test_coverage_active_file() is proving increasingly useful in our workflow where there's (in most cases) there's a one-to-one relationship between files in R/ and in tests/testthat/. However, because covr environment_coverage() calls sys.source() rather than testthat::test_file() we have to recreate much of the test_file() infrastructure in test_coverage_active_file(). And that's fragile and continues to cause problems (see r-lib/devtools#2537 for a recent example).
Could we have a variant of environment_coverage() (either a new argument or a new function) that'd call testthat::test_file()?
I think the one tricky bit with with_coverage() as you have it is making sure that the code is executed in the execution environment that has the traces.
I tried playing around with this a bit today and wasn't able the get it working with the time I allotted to the task, I think there is a bit of a chicken and egg problem with defining the test environment and instrumenting it for coverage. If you can work out a POC that uses test_file() or with_coverage() that would fit your needs I would be happy to merge it.
devtools::test_coverage_active_file()
is proving increasingly useful in our workflow where there's (in most cases) there's a one-to-one relationship between files inR/
and intests/testthat/
. However, because covrenvironment_coverage()
callssys.source()
rather thantestthat::test_file()
we have to recreate much of thetest_file()
infrastructure intest_coverage_active_file()
. And that's fragile and continues to cause problems (see r-lib/devtools#2537 for a recent example).Could we have a variant of
environment_coverage()
(either a new argument or a new function) that'd calltestthat::test_file()
?Or maybe something like this?
The text was updated successfully, but these errors were encountered: