languageserver icon indicating copy to clipboard operation
languageserver copied to clipboard

Unit tests hang when using devtools

Open andycraig opened this issue 6 years ago • 2 comments

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.

andycraig avatar Jun 17 '19 12:06 andycraig

Wouldn't this PR #38 fix this issue???

minkir014 avatar Jun 17 '19 16:06 minkir014

We could:

  • implement a prior check to see if languageserver is installed (using processx::process to 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_all in processx::process(), maybe via a parameter. Could be really useful for dev.

I could do a PR if you think that is a good idea.

kforner avatar Jun 18 '19 07:06 kforner