Skip to content
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

package_coverage(type="example") errors while devtools::run_examples() runs without errors. #358

Open
wolski opened this issue Mar 28, 2019 · 2 comments
Labels
reprex needs a minimal reproducible example

Comments

@wolski
Copy link

wolski commented Mar 28, 2019

Just discovered the great feature of covr (Coverage of Examples). However, I can not get my examples running with covr
Although all of them run with devtools::run_examples or devtools::check. R CMD check etc I cant get them running with :
package_coverage( type="example" )

The error is always:
could not find function "xyz"
in the code generated from the examples of the exported function xyz
Which seems that the package isn't loaded.

I would be happy to debug the problem more closely however, the directory containing the file package-Ex.Rout.fail
is deleted after covr::package_coverage.

Error: Failure in C:/Users/wolski/AppData/Local/Temp/Rtmp2xqd5e/R_LIBS52c0555e627/LFQService/LFQService-Ex.Rout.fail

@jimhester
Copy link
Member

You can use cleanup = FALSE to avoid deleting the files.

@wolski
Copy link
Author

wolski commented Apr 18, 2019

Dear Jim,

Thanks, But can't get package_coverage( type="example" )

Still same problem "could not find function xyz" all over the place.
Only way to get it working is to call
library(abc) at the beginning of each example and then in addition reference all methods within functions expclicitely with abc::xyz.

It is as if all all import and importFrom directives are complete ignored.

@jimhester jimhester added the reprex needs a minimal reproducible example label Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reprex needs a minimal reproducible example
Projects
None yet
Development

No branches or pull requests

2 participants