metrumresearchgroup / mrgvalidate

R package for generating validation documents for other R packages developed by Metrum
https://metrumresearchgroup.github.io/mrgvalidate/
Other
1 stars 1 forks source link

callr issue with devtools::check #2

Open seth127 opened 4 years ago

seth127 commented 4 years ago

Summary

The devtools::check() function should be able to successfully run all package tests.

Tests

There are no specific tests for this because it is about how the tests are being run. However, Drone will run this command so if it is passing then this is satisfied.

seth127 commented 4 years ago

This seems to be related to the issue here: https://github.com/r-lib/devtools/issues/2044#issuecomment-526209877

When I run devtools::check() it fails but when I run devtools::check(cran=FALSE) it works.

seth127 commented 4 years ago

I'm pretty sure I fixed this with this commit https://github.com/metrumresearchgroup/mrgvalidate/commit/109c9e72a54c3eb17f237fd072ee7386040565ae but I'm gonna keep this open until we have drone working and I can be sure it works there too.

Long story short: per that issue linked in the previous comment, devtools::check() by default sets .libPaths() to just a temporary library directory and .Library. The temporary library is populated by symbolic links to the installed copies of all the Depends/Imports and (for the second only) Suggests packages which are not in .Library. so it couldn't find any of the packages that are in rbabylon (and by extension mrgvalidatetestreference) but weren't in mrgvalidate. Adding those to Suggests fixed it.

seth127 commented 4 years ago

Changed the text to correct format for validation. Here was the original issue:

All tests pass with devtools::test() but when I run devtools::check() they die with some variation of the following:

callr subprocess failed: there is no package called ‘mrgvalidatetestreference’
Backtrace:
 1. mrgvalidate::generate_docs(...)
 2. mrgvalidate::write_validation_testing(...)
 3. mrgvalidate::validate_tests(...)
 4. mrgvalidate::run_tests(pkg = pkg, root_dir = root_dir)
 5. callr::r(...)
 6. callr:::get_result(output = out, options)
 7. throw(newerr, parent = remerr[[2]])

Something about the environment or .libPaths() or something inside callr::r() probably. Need to look into it.