The readme states that you can run the full test suite with require('neotest').run.run(vim.fn.getcwd()) if your project root (with go.mod/go.sum in its root) is the current working directory.
Open test summary: :lua require("neotest").summary.open()
Run :lua require('neotest').run.run(vim.fn.getcwd())
See how no tests are being run. If checking the :Neotest output-panel, it says no Go files in /Users/fredrik/code/public/go-playground/lgwt.
For some other projects, I get a different error in the output, like e.g. package github.com/uuu/xxx/yyy: build constraints exclude all Go files in /Users/fredrik/code/work/private/xxx/yyy.
Workaround
If you add a dummy test file in the root of the project, the tests look like they all execute (in e.g. the test summary), but they actually don't execute.
// dummy test file: t_test.go
package main
import "testing"
func TestDummy(*testing.T) {
}
If you also pass recursive_run = true as option to neotest-go, tests will execute.
The readme states that you can run the full test suite with
require('neotest').run.run(vim.fn.getcwd())
if your project root (with go.mod/go.sum in its root) is the current working directory.Reproduce
cd lwgt
nvim
.:lua require("neotest").summary.open()
:lua require('neotest').run.run(vim.fn.getcwd())
:Neotest output-panel
, it saysno Go files in /Users/fredrik/code/public/go-playground/lgwt
.For some other projects, I get a different error in the output, like e.g.
package github.com/uuu/xxx/yyy: build constraints exclude all Go files in /Users/fredrik/code/work/private/xxx/yyy
.Workaround
If you add a dummy test file in the root of the project, the tests look like they all execute (in e.g. the test summary), but they actually don't execute.
If you also pass
recursive_run = true
as option to neotest-go, tests will execute.