neotest-golang hijacks and prevents "run all tests" in a python project #491
mdylanbell
started this conversation in
General
Replies: 2 comments 1 reply
|
Hey @mdylanbell would you mind giving the {
"fredrikaverpil/neotest-golang",
branch = "fix/root-v2"
} |
0 replies
|
That works! Thanks! |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm using a lightly customized LazyVim setup, and use neotest for multiple languages. I have installed the LazyVim extras for python and golang (and probably some others).
When I'm in a python project with tests, and execute Run All Tests (<leader>tT), I almost always get an error from neotest-golang: "The selected directory does not contain a go.mod file or is not part of a Go module". I found this error is prevented if I update
M.Adapter.root(dir)function inlua/neotest-golang/init.luato return nil if a go.mod isn't found, like this:This is pretty similar to a patch in the latest release that properly calculates the project root, the difference is it returns
dirand notnilif it doesn't find a project root.I think the main cause is the
logger.errorhere (inlua/runspec/dir.lua):I found if I change this to
logger.info(independently of the above Adapter fix), the problem doesn't occur and my python tests run correctly.I didn't want to file this as a bug report, because I haven't done the diligence of ensuring this is reproducible with a clean config. I guess I'm just wondering if anyone else has noticed this?
Edit:
Here's the full error output from my neovim notifications:
All reactions