Unit tests hang when using devtools
This only affects development, not the end user.
To duplicate:
With languageserver not installed:
devtools::load_all("languageserver")
devtools::test("languageserver")
Output is:
Loading languageserver
Loading required package: testthat
Testing languageserver
✔ | OK F W S | Context
Then is no progress beyond that.
When languageserver is installed, unit tests complete as expected.
@kforner says (#37):
I think this is because the R process run by https://github.com/REditorSupport/languageserver/blob/master/R/languageclient.R#L18 does not find the package, since it is not installed. But there is not any error check at this point. I propose to add a sleep, then a check that the process is still alive, otherwise raise an execption with the error stream content.
Wouldn't this PR #38 fix this issue???
We could:
- implement a prior check to see if languageserver is installed (using
processx::processto be sure to use the same R that is used for the server) - implement a posterior check to see if the R process is still running, and to give the opportunity to raise an error message.
- find a way to use it (if not installed) using
devtools::load_allinprocessx::process(), maybe via a parameter. Could be really useful for dev.
I could do a PR if you think that is a good idea.