ndmitchell / ghcid

Very low feature GHCi based IDE
Other
1.13k stars 114 forks source link

Show output from test command #298

Closed eahlberg closed 4 years ago

eahlberg commented 4 years ago

First, thanks for a great library! 🙇‍♂️

I have a problem where I'm running a Yesod app using:

ghcid  \
  --command "stack ghci --main-is app:exe:app --ghci-options=-fobject-code" \
  --test "DevelMain.update"

I'd like to see the output from DevelMain.update (in my case Yesod request logging), but it somehow gets swallowed and the only output is the compilation output. Is there any way to show both compilation output and the underlying output?

Sounds a bit like #137 but I'm not quite sure.

ndmitchell commented 4 years ago

Does the function DevelMain.update start, print some stuff, then finish? If so, that output is definitely meant to go to the screen. The case of #137 is only for when the test finishes, but continues to print output later on. Which is it in this case?

eahlberg commented 4 years ago

DevelMain.update comes with Yesod and I'm not sure what happens under the hood, but if I run it from ghci it starts, prints some stuff and then print logs on incoming web requests.

In contrast to ghcid where it starts, prints some stuff, but does not print any logs.

zarybnicky commented 4 years ago

This is most definitely #137, I just encountered this issue after some time away from Yesod. DevelMain.update forkIOs a background thread and returns, with the server outputting to the console afterwards. The thing is, I don't recall this being a problem before (that was maybe 1.5 years ago, not sure), although maybe then I wasn't running update but directly main.

ndmitchell commented 4 years ago

Cool, closing this issue in favour of #137 and noting on there it applies to Yesod too.