Closed julien-h2 closed 2 months ago
Hi @julien-h this has been reported in the past.
In essence, when the go test
command executes, output is generated to stdout. This is later parsed as jsonlines by the neotest-golang adapter. In your case, there are very likely issues with processing this output. The end result being that the tests executed can not be associated with the relevant output (so to properly populate test status, show relevant errors etc).
It would be interesting (for me) to better understand what is the root cause in your case. You can enable DEBUG-level logging (details in the README) and attach the logs here. It will cast light on what the test command output looks like, when captured by the adapter.
There's a workaround for now, which means installing gotestsum and configuring runner = "gotestsum"
in your neotest-golang adapter opts. I opened a draft PR which outlines this here, as this is still an in-progress and undocumented feature: https://github.com/fredrikaverpil/neotest-golang/pull/150
Hello, thank you for your reply. Here is the output with DEBUG enabled:
I have added gotestsum in the configuration but sadly I still have the same problem. Here is how I added the configuration:
And here is the debug output:
Here's the output of both go test
and gotestsum
:
:!go test
:!gotestsum
:!go env
After a few tests, the command go test -race
failed. I googled around and found out that clang
is not supported to run with the -race
option, so I installed gcc
and now it works. So changing the runner to gotestsum
and installing gcc fixed the issue.
Thank you for your help :) And thank you so much for this awesome plugin!
Aha!
Maybe I should remove -race
from the default args, actually.
I'm glad to hear it works for you now!
As a side note, I'd be in favor of keeping it. Good production-ready defaults are great!
Did you check docs and existing issues?
Neovim version (nvim -v)
NVIM v0.10.1
Operating system/version
Windows 11
Output from
:checkhealth neotest-golang
Describe the bug
It seems that neotest-golang correctly finds the tests as they are displayed in the summary (see screenshot), but is unable to run them and triggers this warning instead:
Also note that running
:! go test .
works properly as expected.Steps To Reproduce
test-core
andgo
in the extra, which install neotest and neotest-golang. |<leader>tt
to run the tests.Expected Behavior
The test should run properly and says pass/fail
Your Lua setup