Currently, if the folder in which you start neovim doesn't contain a go.mod/go.sum, tests are not detected.
What was done in this PR?
Search the folder tree for go.mod/go.sum files and if found, return the current working folder as the root of the project. This causes tests to be found in neotest.
Notes
Currently, a max depth of 100 is default, which is on the larger side. This could be set lower, and be configurable.
Closing this, as I realize it's likely better to just return the current cwd as the root dir. The reason is neotest-golang is setting the cwd for both go test and dap.
Why this change?
Currently, if the folder in which you start neovim doesn't contain a
go.mod
/go.sum
, tests are not detected.What was done in this PR?
Search the folder tree for
go.mod
/go.sum
files and if found, return the current working folder as the root of the project. This causes tests to be found in neotest.Notes
Currently, a max depth of 100 is default, which is on the larger side. This could be set lower, and be configurable.