fredrikaverpil / neotest-golang

Reliable Neotest adapter for running Go tests in Neovim.
MIT License
139 stars 17 forks source link

bug: Test(s) not associated (not found/executed) #193

Closed julien-h2 closed 2 months ago

julien-h2 commented 2 months ago

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

neotest-golang: require("neotest-golang.health").check()

Requirements ~
- OK Binary 'go' found on PATH: C:\Program Files\Go\bin\go.EXE
- OK Found go.mod file for C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\greetings_test.go in C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\go.mod
- OK Treesitter parser for go is installed
- OK neotest is available
- OK nvim-treesitter is available
- OK nio is available
- OK plenary is available

DAP (optional) ~
- WARNING Binary 'dlv' not found on PATH
- WARNING dap is not available
- WARNING dapui is not available
- WARNING dap-go is not available

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:

  Warn  12:26:24 AM notify.warn Test(s) not associated (not found/executed):  { 
"C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloName", 
"C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloEmpty"
 }

Also note that running :! go test . works properly as expected.

Steps To Reproduce

  1. Completely Fresh install of LazyVim, start nvim let it download everything then
  2. enable test-core and go in the extra, which install neotest and neotest-golang. |
  3. Then move to module directory, open test file and run <leader>tt to run the tests.

Expected Behavior

The test should run properly and says pass/fail

Screenshot 2024-09-20 002416

Your Lua setup

Untouched LazyVim config with neotest and neotest-golang extras enabled
fredrikaverpil commented 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

julien-h2 commented 2 months ago

Hello, thank you for your reply. Here is the output with DEBUG enabled:

logs ``` DEBUG | 2024-09-20T09:57:14Z+0400 | ...cal/nvim-data/lazy/neotest/lua/neotest/lib/file/init.lua:225 | Path separator: \ INFO | 2024-09-20T09:57:14Z+0400 | ...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:33 | Starting child process INFO | 2024-09-20T09:57:14Z+0400 | ...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:36 | Parent address: localhost:53573 INFO | 2024-09-20T09:57:14Z+0400 | ...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:42 | Starting child process with command: C:\Program Files\Neovim\bin\nvim.exe --embed --headless -n INFO | 2024-09-20T09:57:14Z+0400 | ...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:378 | Initialising client INFO | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting starting event DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event starting INFO | 2024-09-20T09:57:14Z+0400 | ...cal/nvim-data/lazy/neotest/lua/neotest/adapters/init.lua:18 | Found 1 adapters for directory C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings DEBUG | 2024-09-20T09:57:14Z+0400 | ...cal/nvim-data/lazy/neotest/lua/neotest/adapters/init.lua:19 | Adapters: { { adapter = { build_spec = , discover_positions = , filter_dir = , init = , is_test_file = , name = "neotest-golang", results = , root = , = { __call = } }, root = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings" } } INFO | 2024-09-20T09:57:14Z+0400 | ...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:279 | Searching C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings for test files DEBUG | 2024-09-20T09:57:14Z+0400 | ...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:295 | Found { { id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", name = "greetings", path = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", type = "dir" }, { { id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", name = "greetings_test.go", path = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", type = "file" } } } DEBUG | 2024-09-20T09:57:14Z+0400 | ...nvim-data/lazy/neotest/lua/neotest/client/state/init.lua:54 | New positions at ID C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings INFO | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting discover_positions event DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener state for event discover_positions DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener status for event discover_positions DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener diagnostic for event discover_positions INFO | 2024-09-20T09:57:14Z+0400 | ...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:325 | Discovering files with 24 workers DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event discover_positions INFO | 2024-09-20T09:57:14Z+0400 | ...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:299 | Parsing C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\greetings_test.go DEBUG | 2024-09-20T09:57:14Z+0400 | ...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:140 | Waiting for result 1 DEBUG | 2024-09-20T09:57:14Z+0400 | ...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:91 | Result registed for callback 1 DEBUG | 2024-09-20T09:57:14Z+0400 | ...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:305 | Found { { id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", name = "greetings_test.go", path = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", range = { 0, 0, 22, 0 }, type = "file" }, { { id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloName", name = "TestHelloName", path = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", range = { 7, 0, 14, 1 }, type = "test" } }, { { id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloEmpty", name = "TestHelloEmpty", path = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", range = { 16, 0, 21, 1 }, type = "test" } } } DEBUG | 2024-09-20T09:57:14Z+0400 | ...nvim-data/lazy/neotest/lua/neotest/client/state/init.lua:54 | New positions at ID C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\greetings_test.go INFO | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting discover_positions event DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener state for event discover_positions DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener status for event discover_positions DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener diagnostic for event discover_positions DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event discover_positions INFO | 2024-09-20T09:57:14Z+0400 | ...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:494 | Initialisation finished in 0.058 seconds INFO | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting test_file_focused event DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener status for event test_file_focused DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener diagnostic for event test_file_focused DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event test_file_focused INFO | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting started event DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event started DEBUG | 2024-09-20T09:57:14Z+0400 | ...nvim-data/lazy/neotest/lua/neotest/client/state/init.lua:85 | Setting positions to running C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\greetings_test.go INFO | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting run event DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener state for event run DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener status for event run DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener diagnostic for event run DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event run DEBUG | 2024-09-20T09:57:14Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Searching for go.mod in C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings DEBUG | 2024-09-20T09:57:14Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Found go.mod at C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\go.mod DEBUG | 2024-09-20T09:57:14Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Running Go list: go list -json ./... in C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings DEBUG | 2024-09-20T09:57:14Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] JSON-decoded 'go list' output: { { Deps = { "cmp", "errors", "fmt", "internal/abi", "internal/asan", "internal/bisect", "internal/bytealg", "internal/byteorder", "internal/chacha8rand", "internal/coverage/rtcov", "internal/cpu", "internal/filepathlite", "internal/fmtsort", "internal/goarch", "internal/godebug", "internal/godebugs", "internal/goexperiment", "internal/goos", "internal/itoa", "internal/msan", "internal/oserror", "internal/poll", "internal/profilerecord", "internal/race", "internal/reflectlite", "internal/runtime/atomic", "internal/runtime/exithook", "internal/stringslite", "internal/syscall/execenv", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "internal/testlog", "internal/unsafeheader", "io", "io/fs", "iter", "math", "math/bits", "math/rand", "os", "path", "reflect", "runtime", "runtime/internal/math", "runtime/internal/sys", "slices", "strconv", "sync", "sync/atomic", "syscall", "time", "unicode", "unicode/utf16", "unicode/utf8", "unsafe" }, Dir = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", GoFiles = { "greetings.go" }, ImportPath = "ex.com/greetings", Imports = { "errors", "fmt", "math/rand" }, Match = { "./..." }, Module = { Dir = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", GoMod = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\go.mod", GoVersion = "1.23.0", Main = true, Path = "ex.com/greetings" }, Name = "greetings", Root = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", Stale = true, StaleReason = "build ID mismatch", TestGoFiles = { "greetings_test.go" }, TestImports = { "regexp", "testing" } } } INFO | 2024-09-20T09:57:14Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:59 | [neotest-golang] Test command: go test -json -v -race -count=1 ex.com/greetings -run ^(^TestHelloName$|^TestHelloEmpty$)$ DEBUG | 2024-09-20T09:57:14Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] RunSpec: { command = { "go", "test", "-json", "-v", "-race", "-count=1", "ex.com/greetings", "-run", "^(^TestHelloName$|^TestHelloEmpty$)$" }, context = { golist_data = { { Deps = { "cmp", "errors", "fmt", "internal/abi", "internal/asan", "internal/bisect", "internal/bytealg", "internal/byteorder", "internal/chacha8rand", "internal/coverage/rtcov", "internal/cpu", "internal/filepathlite", "internal/fmtsort", "internal/goarch", "internal/godebug", "internal/godebugs", "internal/goexperiment", "internal/goos", "internal/itoa", "internal/msan", "internal/oserror", "internal/poll", "internal/profilerecord", "internal/race", "internal/reflectlite", "internal/runtime/atomic", "internal/runtime/exithook", "internal/stringslite", "internal/syscall/execenv", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "internal/testlog", "internal/unsafeheader", "io", "io/fs", "iter", "math", "math/bits", "math/rand", "os", "path", "reflect", "runtime", "runtime/internal/math", "runtime/internal/sys", "slices", "strconv", "sync", "sync/atomic", "syscall", "time", "unicode", "unicode/utf16", "unicode/utf8", "unsafe" }, Dir = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", GoFiles = { "greetings.go" }, ImportPath = "ex.com/greetings", Imports = { "errors", "fmt", "math/rand" }, Match = { "./..." }, Module = { Dir = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", GoMod = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\go.mod", GoVersion = "1.23.0", Main = true, Path = "ex.com/greetings" }, Name = "greetings", Root = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", Stale = true, StaleReason = "build ID mismatch", TestGoFiles = { "greetings_test.go" }, TestImports = { "regexp", "testing" } } }, pos_id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go" }, cwd = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings" } INFO | 2024-09-20T09:57:14Z+0400 | ...data/lazy/neotest/lua/neotest/client/strategies/init.lua:36 | Starting process neotest-golang:C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings-C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\greetings_test.go with strategy integrated DEBUG | 2024-09-20T09:57:14Z+0400 | ...data/lazy/neotest/lua/neotest/client/strategies/init.lua:37 | Strategy spec { command = { "go", "test", "-json", "-v", "-race", "-count=1", "ex.com/greetings", "-run", "^(^TestHelloName$|^TestHelloEmpty$)$" }, context = { golist_data = { { Deps = { "cmp", "errors", "fmt", "internal/abi", "internal/asan", "internal/bisect", "internal/bytealg", "internal/byteorder", "internal/chacha8rand", "internal/coverage/rtcov", "internal/cpu", "internal/filepathlite", "internal/fmtsort", "internal/goarch", "internal/godebug", "internal/godebugs", "internal/goexperiment", "internal/goos", "internal/itoa", "internal/msan", "internal/oserror", "internal/poll", "internal/profilerecord", "internal/race", "internal/reflectlite", "internal/runtime/atomic", "internal/runtime/exithook", "internal/stringslite", "internal/syscall/execenv", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "internal/testlog", "internal/unsafeheader", "io", "io/fs", "iter", "math", "math/bits", "math/rand", "os", "path", "reflect", "runtime", "runtime/internal/math", "runtime/internal/sys", "slices", "strconv", "sync", "sync/atomic", "syscall", "time", "unicode", "unicode/utf16", "unicode/utf8", "unsafe" }, Dir = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", GoFiles = { "greetings.go" }, ImportPath = "ex.com/greetings", Imports = { "errors", "fmt", "math/rand" }, Match = { "./..." }, Module = { Dir = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", GoMod = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\go.mod", GoVersion = "1.23.0", Main = true, Path = "ex.com/greetings" }, Name = "greetings", Root = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", Stale = true, StaleReason = "build ID mismatch", TestGoFiles = { "greetings_test.go" }, TestImports = { "regexp", "testing" } } }, pos_id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go" }, cwd = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", strategy = { height = 40, width = 120 } } INFO | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting test_focused event DEBUG | 2024-09-20T09:57:14Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event test_focused INFO | 2024-09-20T09:57:17Z+0400 | ...data/lazy/neotest/lua/neotest/client/strategies/init.lua:56 | Process for position neotest-golang:C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings-C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\greetings_test.go exited with code 1 DEBUG | 2024-09-20T09:57:17Z+0400 | ...data/lazy/neotest/lua/neotest/client/strategies/init.lua:58 | Output of process C:\Users\Julien\AppData\Local\Temp\nvim.0\xvhNwD\1 DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Raw 'go test' output: { "\27[?25l\27[2J\27[m\27[H# ex.com/greetings.test", "C:\\Program Files\\Go\\pkg\\tool\\windows_amd64\\link.exe: running clang failed: exit status 1104", "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\Llvm\\x64\\bin\\clang.exe -m64 -s -mconsole -Wl,--tsaware -Wl,--nxcompat -Wl,--major-os-version=6 -Wl,--minor-os-version=1 -Wl,--major-subsystem-version=6 -Wl,--minor-subsystem-version=1 -o $WORK\\b001\\greetings.test.exe -Qunused-arguments C:\\Users\\Julien\\AppData\\Local\\Temp\\go-link-3835921888\\go.o C:\\Users\\Julien\\AppData\\Local\\Temp\\go-link-3835921888\\000000.o C:\\Users\\Julien\\AppData\\Local\\Temp\\go-link-3835921888\\000001.o C:\\Users\\Julien\\AppData\\Local\\Temp\\go-link-3835921888\\000002.o C:\\Users\\Julien\\AppData\\Local\\Temp\\go-link-3835921888\\000003.o C:\\Users\\Julien\\AppData\\Local\\Temp\\go-link-3835921888\\000004.o C:\\Users\\Julien\\AppData\\Local\\Temp\\go-link-3835921888\\000005.o C:\\Users\\Julien\\AppData\\Local\\Temp\\go-link-3835921888\\000006.o C:\\Users\\Julien\\AppData\\Local\\Temp\\go-link-3835921888\\000007.o C:\\Users\\Julien\\AppData\\Local\\Temp\\go-link-3835921888\\000008.o C:\\Users\\Julien\\AppData\\Local\\Temp\\go-link-3835921888\\000009.o C:\\Users\\Julien\\AppData\\Local\\Temp\\go-link-3835921888\\000010.o -O2 -g -O2 -g -no-pie -Wl,-T,C:\\Users\\Julien\\AppData\\Local\\Temp\\go-link-3835921888\\fix_debug_gdb_scripts.ld -Wl,--start-group -lmingwex -lmingw32 -Wl,--end-group -lkernel32", "LINK : warning LNK4044: unrecognized option '/-tsaware'; ignored", "LINK : warning LNK4044: unrecognized option '/-nxcompat'; ignored", "LINK : warning LNK4044: unrecognized option '/-major-os-version=6'; ignored", "LINK : warning LNK4044: unrecognized option '/-minor-os-version=1'; ignored", "LINK : warning LNK4044: unrecognized option '/-major-subsystem-version=6'; ignored", "LINK : warning LNK4044: unrecognized option '/-minor-subsystem-version=1'; ignored", "LINK : warning LNK4044: unrecognized option '/T'; ignored", "LINK : warning LNK4044: unrecognized option '/-start-group'; ignored", "LINK : warning LNK4044: unrecognized option '/-end-group'; ignored", "LINK : fatal error LNK1104: cannot open file 'mingwex.lib'", 'clang: error: linker command failed with exit code 1104 (use -v to see invocation)\27[26;1H{"Time":"2024-09-20T09:57:16.9691788+04:00","Action":"start","Package":"ex.com/greetings"}', '{"Time":"2024-09-20T09:57:16.9692638+04:00","Action":"output","Package":"ex.com/greetings","Output":"FAIL\\tex.com/greetings [build failed]\\n"}', '{"Time":"2024-09-20T09:57:16.9692638+04:00","Action":"fail","Package":"ex.com/greetings","Elapsed":0}', "\27]0;C:\\Program Files\\Go\\bin\\go.EXE\a\27[?25h" } DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Not valid JSON: [?25l# ex.com/greetings.test DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Not valid JSON: C:\Program Files\Go\pkg\tool\windows_amd64\link.exe: running clang failed: exit status 1104 DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Not valid JSON: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\Llvm\x64\bin\clang.exe -m64 -s -mconsole -Wl,--tsaware -Wl,--nxcompat -Wl,--major-os-version=6 -Wl,--minor-os-version=1 -Wl,--major-subsystem-version=6 -Wl,--minor-subsystem-version=1 -o $WORK\b001\greetings.test.exe -Qunused-arguments C:\Users\Julien\AppData\Local\Temp\go-link-3835921888\go.o C:\Users\Julien\AppData\Local\Temp\go-link-3835921888\000000.o C:\Users\Julien\AppData\Local\Temp\go-link-3835921888\000001.o C:\Users\Julien\AppData\Local\Temp\go-link-3835921888\000002.o C:\Users\Julien\AppData\Local\Temp\go-link-3835921888\000003.o C:\Users\Julien\AppData\Local\Temp\go-link-3835921888\000004.o C:\Users\Julien\AppData\Local\Temp\go-link-3835921888\000005.o C:\Users\Julien\AppData\Local\Temp\go-link-3835921888\000006.o C:\Users\Julien\AppData\Local\Temp\go-link-3835921888\000007.o C:\Users\Julien\AppData\Local\Temp\go-link-3835921888\000008.o C:\Users\Julien\AppData\Local\Temp\go-link-3835921888\000009.o C:\Users\Julien\AppData\Local\Temp\go-link-3835921888\000010.o -O2 -g -O2 -g -no-pie -Wl,-T,C:\Users\Julien\AppData\Local\Temp\go-link-3835921888\fix_debug_gdb_scripts.ld -Wl,--start-group -lmingwex -lmingw32 -Wl,--end-group -lkernel32 DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Not valid JSON: LINK : warning LNK4044: unrecognized option '/-tsaware'; ignored DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Not valid JSON: LINK : warning LNK4044: unrecognized option '/-nxcompat'; ignored DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Not valid JSON: LINK : warning LNK4044: unrecognized option '/-major-os-version=6'; ignored DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Not valid JSON: LINK : warning LNK4044: unrecognized option '/-minor-os-version=1'; ignored DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Not valid JSON: LINK : warning LNK4044: unrecognized option '/-major-subsystem-version=6'; ignored DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Not valid JSON: LINK : warning LNK4044: unrecognized option '/-minor-subsystem-version=1'; ignored DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Not valid JSON: LINK : warning LNK4044: unrecognized option '/T'; ignored DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Not valid JSON: LINK : warning LNK4044: unrecognized option '/-start-group'; ignored DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Not valid JSON: LINK : warning LNK4044: unrecognized option '/-end-group'; ignored DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Not valid JSON: LINK : fatal error LNK1104: cannot open file 'mingwex.lib' DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Not valid JSON: clang: error: linker command failed with exit code 1104 (use -v to see invocation){"Time":"2024-09-20T09:57:16.9691788+04:00","Action":"start","Package":"ex.com/greetings"} DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Not valid JSON: ]0;C:\Program Files\Go\bin\go.EXE[?25h DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Final internal test result data { ["C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloEmpty"] = { duplicate_test_detected = false, errors = {}, gotest_data = { name = "", output = {}, pkg = "" }, neotest_data = { id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloEmpty", name = "TestHelloEmpty", path = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", range = { 16, 0, 21, 1 }, type = "test" }, status = "skipped" }, ["C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloName"] = { duplicate_test_detected = false, errors = {}, gotest_data = { name = "", output = {}, pkg = "" }, neotest_data = { id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloName", name = "TestHelloName", path = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", range = { 7, 0, 14, 1 }, type = "test" }, status = "skipped" } } WARN | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:69 | [neotest-golang] Test(s) not associated (not found/executed): { "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloName", "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloEmpty" } DEBUG | 2024-09-20T09:57:17Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Final Neotest result data { ["C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go"] = { output = "C:/Users/Julien/AppData/Local/Temp/nvim.0/xvhNwD/4", status = "failed" }, ["C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloEmpty"] = { errors = {}, output = "C:/Users/Julien/AppData/Local/Temp/nvim.0/xvhNwD/3", status = "skipped" }, ["C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloName"] = { errors = {}, output = "C:/Users/Julien/AppData/Local/Temp/nvim.0/xvhNwD/2", status = "skipped" } } DEBUG | 2024-09-20T09:57:17Z+0400 | ...nvim-data/lazy/neotest/lua/neotest/client/state/init.lua:70 | New results for adapter neotest-golang:C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings INFO | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting results event DEBUG | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener state for event results DEBUG | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener output_panel for event results DEBUG | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener diagnostic for event results DEBUG | 2024-09-20T09:57:17Z+0400 | ...m-data/lazy/neotest/lua/neotest/consumers/diagnostic.lua:55 | Setting diagnostics for C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\greetings_test.go {} DEBUG | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event results DEBUG | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener status for event results DEBUG | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener output for event results DEBUG | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener quickfix for event results DEBUG | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener trouble for event results DEBUG | 2024-09-20T09:57:17Z+0400 | ...nvim-data/lazy/neotest/lua/neotest/client/state/init.lua:70 | New results for adapter neotest-golang:C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings INFO | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting results event DEBUG | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener state for event results DEBUG | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener output_panel for event results DEBUG | 2024-09-20T09:57:17Z+0400 | ...cal/nvim-data/lazy/neotest/lua/neotest/lib/file/init.lua:23 | Reading file: C:/Users/Julien/AppData/Local/Temp/nvim.0/xvhNwD/3 DEBUG | 2024-09-20T09:57:17Z+0400 | ...cal/nvim-data/lazy/neotest/lua/neotest/lib/file/init.lua:23 | Reading file: C:/Users/Julien/AppData/Local/Temp/nvim.0/xvhNwD/2 DEBUG | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener diagnostic for event results DEBUG | 2024-09-20T09:57:17Z+0400 | ...m-data/lazy/neotest/lua/neotest/consumers/diagnostic.lua:55 | Setting diagnostics for C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\greetings_test.go {} DEBUG | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event results DEBUG | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener status for event results DEBUG | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener output for event results DEBUG | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener quickfix for event results DEBUG | 2024-09-20T09:57:17Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener trouble for event results ```
julien-h2 commented 2 months ago

I have added gotestsum in the configuration but sadly I still have the same problem. Here is how I added the configuration:

lua config ```lua return { { "nvim-neotest/neotest", optional = true, dependencies = { "fredrikaverpil/neotest-golang", }, opts = { adapters = { ["neotest-golang"] = { -- Here we can set options for neotest-golang, e.g. -- go_test_args = { "-v", "-race", "-count=1", "-timeout=60s" }, dap_go_enabled = true, -- requires leoluz/nvim-dap-go runner = "gotestsum", }, }, }, }, } ```

And here is the debug output:

logs ``` DEBUG | 2024-09-20T10:12:41Z+0400 | ...cal/nvim-data/lazy/neotest/lua/neotest/lib/file/init.lua:225 | Path separator: \ INFO | 2024-09-20T10:12:41Z+0400 | ...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:33 | Starting child process INFO | 2024-09-20T10:12:41Z+0400 | ...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:36 | Parent address: localhost:54013 INFO | 2024-09-20T10:12:41Z+0400 | ...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:42 | Starting child process with command: C:\Program Files\Neovim\bin\nvim.exe --embed --headless -n INFO | 2024-09-20T10:12:41Z+0400 | ...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:378 | Initialising client INFO | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting starting event DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event starting INFO | 2024-09-20T10:12:41Z+0400 | ...cal/nvim-data/lazy/neotest/lua/neotest/adapters/init.lua:18 | Found 1 adapters for directory C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings DEBUG | 2024-09-20T10:12:41Z+0400 | ...cal/nvim-data/lazy/neotest/lua/neotest/adapters/init.lua:19 | Adapters: { { adapter = { build_spec = , discover_positions = , filter_dir = , init = , is_test_file = , name = "neotest-golang", results = , root = , = { __call = } }, root = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings" } } INFO | 2024-09-20T10:12:41Z+0400 | ...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:279 | Searching C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings for test files DEBUG | 2024-09-20T10:12:41Z+0400 | ...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:295 | Found { { id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", name = "greetings", path = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", type = "dir" }, { { id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", name = "greetings_test.go", path = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", type = "file" } } } DEBUG | 2024-09-20T10:12:41Z+0400 | ...nvim-data/lazy/neotest/lua/neotest/client/state/init.lua:54 | New positions at ID C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings INFO | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting discover_positions event DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event discover_positions DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener diagnostic for event discover_positions INFO | 2024-09-20T10:12:41Z+0400 | ...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:325 | Discovering files with 24 workers DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener status for event discover_positions DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener state for event discover_positions INFO | 2024-09-20T10:12:41Z+0400 | ...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:299 | Parsing C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\greetings_test.go DEBUG | 2024-09-20T10:12:41Z+0400 | ...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:140 | Waiting for result 1 DEBUG | 2024-09-20T10:12:41Z+0400 | ...al/nvim-data/lazy/neotest/lua/neotest/lib/subprocess.lua:91 | Result registed for callback 1 DEBUG | 2024-09-20T10:12:41Z+0400 | ...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:305 | Found { { id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", name = "greetings_test.go", path = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", range = { 0, 0, 22, 0 }, type = "file" }, { { id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloName", name = "TestHelloName", path = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", range = { 7, 0, 14, 1 }, type = "test" } }, { { id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloEmpty", name = "TestHelloEmpty", path = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", range = { 16, 0, 21, 1 }, type = "test" } } } DEBUG | 2024-09-20T10:12:41Z+0400 | ...nvim-data/lazy/neotest/lua/neotest/client/state/init.lua:54 | New positions at ID C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\greetings_test.go INFO | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting discover_positions event DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event discover_positions DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener diagnostic for event discover_positions DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener status for event discover_positions DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener state for event discover_positions INFO | 2024-09-20T10:12:41Z+0400 | ...Local/nvim-data/lazy/neotest/lua/neotest/client/init.lua:494 | Initialisation finished in 0.03 seconds INFO | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting test_file_focused event DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event test_file_focused DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener diagnostic for event test_file_focused DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener status for event test_file_focused INFO | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting started event DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event started DEBUG | 2024-09-20T10:12:41Z+0400 | ...nvim-data/lazy/neotest/lua/neotest/client/state/init.lua:85 | Setting positions to running C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\greetings_test.go INFO | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting run event DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event run DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener diagnostic for event run DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener status for event run DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener state for event run DEBUG | 2024-09-20T10:12:41Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Searching for go.mod in C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings DEBUG | 2024-09-20T10:12:41Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Found go.mod at C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\go.mod DEBUG | 2024-09-20T10:12:41Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Running Go list: go list -json ./... in C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings DEBUG | 2024-09-20T10:12:41Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] JSON-decoded 'go list' output: { { Deps = { "cmp", "errors", "fmt", "internal/abi", "internal/asan", "internal/bisect", "internal/bytealg", "internal/byteorder", "internal/chacha8rand", "internal/coverage/rtcov", "internal/cpu", "internal/filepathlite", "internal/fmtsort", "internal/goarch", "internal/godebug", "internal/godebugs", "internal/goexperiment", "internal/goos", "internal/itoa", "internal/msan", "internal/oserror", "internal/poll", "internal/profilerecord", "internal/race", "internal/reflectlite", "internal/runtime/atomic", "internal/runtime/exithook", "internal/stringslite", "internal/syscall/execenv", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "internal/testlog", "internal/unsafeheader", "io", "io/fs", "iter", "math", "math/bits", "math/rand", "os", "path", "reflect", "runtime", "runtime/internal/math", "runtime/internal/sys", "slices", "strconv", "sync", "sync/atomic", "syscall", "time", "unicode", "unicode/utf16", "unicode/utf8", "unsafe" }, Dir = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", GoFiles = { "greetings.go" }, ImportPath = "ex.com/greetings", Imports = { "errors", "fmt", "math/rand" }, Match = { "./..." }, Module = { Dir = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", GoMod = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\go.mod", GoVersion = "1.23.0", Main = true, Path = "ex.com/greetings" }, Name = "greetings", Root = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", Stale = true, StaleReason = "build ID mismatch", TestGoFiles = { "greetings_test.go" }, TestImports = { "regexp", "testing" } } } INFO | 2024-09-20T10:12:41Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:59 | [neotest-golang] Test command: gotestsum --jsonfile=C:/Users/Julien/AppData/Local/Temp/nvim.0/Ajb5cu/1 --format=standard-verbose -- -v -race -count=1 ex.com/greetings -run ^(^TestHelloName$|^TestHelloEmpty$)$ DEBUG | 2024-09-20T10:12:41Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] RunSpec: { command = { "gotestsum", "--jsonfile=C:/Users/Julien/AppData/Local/Temp/nvim.0/Ajb5cu/1", "--format=standard-verbose", "--", "-v", "-race", "-count=1", "ex.com/greetings", "-run", "^(^TestHelloName$|^TestHelloEmpty$)$" }, context = { golist_data = { { Deps = { "cmp", "errors", "fmt", "internal/abi", "internal/asan", "internal/bisect", "internal/bytealg", "internal/byteorder", "internal/chacha8rand", "internal/coverage/rtcov", "internal/cpu", "internal/filepathlite", "internal/fmtsort", "internal/goarch", "internal/godebug", "internal/godebugs", "internal/goexperiment", "internal/goos", "internal/itoa", "internal/msan", "internal/oserror", "internal/poll", "internal/profilerecord", "internal/race", "internal/reflectlite", "internal/runtime/atomic", "internal/runtime/exithook", "internal/stringslite", "internal/syscall/execenv", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "internal/testlog", "internal/unsafeheader", "io", "io/fs", "iter", "math", "math/bits", "math/rand", "os", "path", "reflect", "runtime", "runtime/internal/math", "runtime/internal/sys", "slices", "strconv", "sync", "sync/atomic", "syscall", "time", "unicode", "unicode/utf16", "unicode/utf8", "unsafe" }, Dir = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", GoFiles = { "greetings.go" }, ImportPath = "ex.com/greetings", Imports = { "errors", "fmt", "math/rand" }, Match = { "./..." }, Module = { Dir = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", GoMod = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\go.mod", GoVersion = "1.23.0", Main = true, Path = "ex.com/greetings" }, Name = "greetings", Root = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", Stale = true, StaleReason = "build ID mismatch", TestGoFiles = { "greetings_test.go" }, TestImports = { "regexp", "testing" } } }, pos_id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", test_output_json_filepath = "C:/Users/Julien/AppData/Local/Temp/nvim.0/Ajb5cu/1" }, cwd = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings" } INFO | 2024-09-20T10:12:41Z+0400 | ...data/lazy/neotest/lua/neotest/client/strategies/init.lua:36 | Starting process neotest-golang:C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings-C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\greetings_test.go with strategy integrated DEBUG | 2024-09-20T10:12:41Z+0400 | ...data/lazy/neotest/lua/neotest/client/strategies/init.lua:37 | Strategy spec { command = { "gotestsum", "--jsonfile=C:/Users/Julien/AppData/Local/Temp/nvim.0/Ajb5cu/1", "--format=standard-verbose", "--", "-v", "-race", "-count=1", "ex.com/greetings", "-run", "^(^TestHelloName$|^TestHelloEmpty$)$" }, context = { golist_data = { { Deps = { "cmp", "errors", "fmt", "internal/abi", "internal/asan", "internal/bisect", "internal/bytealg", "internal/byteorder", "internal/chacha8rand", "internal/coverage/rtcov", "internal/cpu", "internal/filepathlite", "internal/fmtsort", "internal/goarch", "internal/godebug", "internal/godebugs", "internal/goexperiment", "internal/goos", "internal/itoa", "internal/msan", "internal/oserror", "internal/poll", "internal/profilerecord", "internal/race", "internal/reflectlite", "internal/runtime/atomic", "internal/runtime/exithook", "internal/stringslite", "internal/syscall/execenv", "internal/syscall/windows", "internal/syscall/windows/registry", "internal/syscall/windows/sysdll", "internal/testlog", "internal/unsafeheader", "io", "io/fs", "iter", "math", "math/bits", "math/rand", "os", "path", "reflect", "runtime", "runtime/internal/math", "runtime/internal/sys", "slices", "strconv", "sync", "sync/atomic", "syscall", "time", "unicode", "unicode/utf16", "unicode/utf8", "unsafe" }, Dir = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", GoFiles = { "greetings.go" }, ImportPath = "ex.com/greetings", Imports = { "errors", "fmt", "math/rand" }, Match = { "./..." }, Module = { Dir = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", GoMod = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\go.mod", GoVersion = "1.23.0", Main = true, Path = "ex.com/greetings" }, Name = "greetings", Root = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", Stale = true, StaleReason = "build ID mismatch", TestGoFiles = { "greetings_test.go" }, TestImports = { "regexp", "testing" } } }, pos_id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", test_output_json_filepath = "C:/Users/Julien/AppData/Local/Temp/nvim.0/Ajb5cu/1" }, cwd = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings", strategy = { height = 40, width = 120 } } INFO | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting test_focused event DEBUG | 2024-09-20T10:12:41Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event test_focused INFO | 2024-09-20T10:12:42Z+0400 | ...data/lazy/neotest/lua/neotest/client/strategies/init.lua:56 | Process for position neotest-golang:C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings-C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\greetings_test.go exited with code 1 DEBUG | 2024-09-20T10:12:42Z+0400 | ...data/lazy/neotest/lua/neotest/client/strategies/init.lua:58 | Output of process C:\Users\Julien\AppData\Local\Temp\nvim.0\Ajb5cu\2 DEBUG | 2024-09-20T10:12:42Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Raw 'go test' output: { '{"Time":"2024-09-20T10:12:42.738978+04:00","Action":"start","Package":"ex.com/greetings"}', '{"Time":"2024-09-20T10:12:42.738978+04:00","Action":"output","Package":"ex.com/greetings","Output":"FAIL\\tex.com/greetings [build failed]\\n"}', '{"Time":"2024-09-20T10:12:42.738978+04:00","Action":"fail","Package":"ex.com/greetings","Elapsed":0}' } DEBUG | 2024-09-20T10:12:42Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Final internal test result data { ["C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloEmpty"] = { duplicate_test_detected = false, errors = {}, gotest_data = { name = "", output = {}, pkg = "" }, neotest_data = { id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloEmpty", name = "TestHelloEmpty", path = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", range = { 16, 0, 21, 1 }, type = "test" }, status = "skipped" }, ["C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloName"] = { duplicate_test_detected = false, errors = {}, gotest_data = { name = "", output = {}, pkg = "" }, neotest_data = { id = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloName", name = "TestHelloName", path = "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go", range = { 7, 0, 14, 1 }, type = "test" }, status = "skipped" } } WARN | 2024-09-20T10:12:42Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:69 | [neotest-golang] Test(s) not associated (not found/executed): { "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloEmpty", "C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloName" } DEBUG | 2024-09-20T10:12:42Z+0400 | ...-data/lazy/neotest-golang/lua/neotest-golang/logging.lua:47 | [neotest-golang] Final Neotest result data { ["C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go"] = { output = "C:/Users/Julien/AppData/Local/Temp/nvim.0/Ajb5cu/5", status = "failed" }, ["C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloEmpty"] = { errors = {}, output = "C:/Users/Julien/AppData/Local/Temp/nvim.0/Ajb5cu/3", status = "skipped" }, ["C:\\Users\\Julien\\Documents\\mydocs\\src\\golang\\tutorial\\greetings\\greetings_test.go::TestHelloName"] = { errors = {}, output = "C:/Users/Julien/AppData/Local/Temp/nvim.0/Ajb5cu/4", status = "skipped" } } DEBUG | 2024-09-20T10:12:42Z+0400 | ...nvim-data/lazy/neotest/lua/neotest/client/state/init.lua:70 | New results for adapter neotest-golang:C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings INFO | 2024-09-20T10:12:42Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting results event DEBUG | 2024-09-20T10:12:42Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener status for event results DEBUG | 2024-09-20T10:12:42Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener output for event results DEBUG | 2024-09-20T10:12:42Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener state for event results DEBUG | 2024-09-20T10:12:42Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener output_panel for event results DEBUG | 2024-09-20T10:12:42Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event results DEBUG | 2024-09-20T10:12:42Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener diagnostic for event results DEBUG | 2024-09-20T10:12:42Z+0400 | ...m-data/lazy/neotest/lua/neotest/consumers/diagnostic.lua:55 | Setting diagnostics for C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\greetings_test.go {} DEBUG | 2024-09-20T10:12:42Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener trouble for event results DEBUG | 2024-09-20T10:12:42Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener quickfix for event results DEBUG | 2024-09-20T10:12:42Z+0400 | ...nvim-data/lazy/neotest/lua/neotest/client/state/init.lua:70 | New results for adapter neotest-golang:C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings INFO | 2024-09-20T10:12:42Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting results event DEBUG | 2024-09-20T10:12:42Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener status for event results DEBUG | 2024-09-20T10:12:42Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener output for event results DEBUG | 2024-09-20T10:12:42Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener state for event results DEBUG | 2024-09-20T10:12:42Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener output_panel for event results DEBUG | 2024-09-20T10:12:43Z+0400 | ...cal/nvim-data/lazy/neotest/lua/neotest/lib/file/init.lua:23 | Reading file: C:/Users/Julien/AppData/Local/Temp/nvim.0/Ajb5cu/3 DEBUG | 2024-09-20T10:12:43Z+0400 | ...cal/nvim-data/lazy/neotest/lua/neotest/lib/file/init.lua:23 | Reading file: C:/Users/Julien/AppData/Local/Temp/nvim.0/Ajb5cu/4 DEBUG | 2024-09-20T10:12:43Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event results DEBUG | 2024-09-20T10:12:43Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener diagnostic for event results DEBUG | 2024-09-20T10:12:43Z+0400 | ...m-data/lazy/neotest/lua/neotest/consumers/diagnostic.lua:55 | Setting diagnostics for C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\greetings_test.go {} DEBUG | 2024-09-20T10:12:43Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener trouble for event results DEBUG | 2024-09-20T10:12:43Z+0400 | ...vim-data/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener quickfix for event results ```
julien-h2 commented 2 months ago

Here's the output of both go test and gotestsum:

:!go test
output ``` :!go test --- FAIL: TestHelloName (0.00s) greetings_test.go:13: Hello(Cookie) = "Great to see you, Cookie!", , want match for `\bCookie\b`, nil FAIL exit status 1 FAIL ex.com/greetings 0.257s shell returned 1 ```
:!gotestsum
output ``` :!gotestsum ✖ . (188ms) === Failed === FAIL: . TestHelloName (0.00s) greetings_test.go:13: Hello(Cookie) = "Great to see you, Cookie!", , want match for `\bCookie\b`, nil DONE 2 tests, 1 failure in 0.841s shell returned 1 ```
:!go env
output ``` 10:24:18 AM msg_show go env set GO111MODULE= set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\Julien\AppData\Local\go-build set GOENV=C:\Users\Julien\AppData\Roaming\go\env set GOEXE=.exe set GOEXPERIMENT= set GOFLAGS= set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOINSECURE= set GOMODCACHE=C:\Users\Julien\go\pkg\mod set GONOPROXY= set GONOSUMDB= set GOOS=windows set GOPATH=C:\Users\Julien\go set GOPRIVATE= set GOPROXY=https://proxy.golang.org,direct set GOROOT=C:\Program Files\Go set GOSUMDB=sum.golang.org set GOTMPDIR= 10:24:18 AM msg_show go env set GOTOOLCHAIN=auto set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64 set GOVCS= set GOVERSION=go1.23.0 set GODEBUG= set GOTELEMETRY=local set GOTELEMETRYDIR=C:\Users\Julien\AppData\Roaming\go\telemetry set GCCGO=gccgo set GOAMD64=v1 set AR=ar set CC=clang set CXX=g++ set CGO_ENABLED=1 set GOMOD=C:\Users\Julien\Documents\mydocs\src\golang\tutorial\greetings\go.mod set GOWORK= set CGO_CFLAGS=-O2 -g set CGO_CPPFLAGS= set CGO_CXXFLAGS=-O2 -g set CGO_FFLAGS=-O2 -g set CGO_LDFLAGS=-O2 -g set PKG_CONFIG=pkg-config set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=C:\Users\Julien\AppData\Local\Temp\go-build2197062559=/tmp/go-build -gno-record-gcc-switches ```
julien-h2 commented 2 months ago

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!

fredrikaverpil commented 2 months ago

Aha!

Maybe I should remove -race from the default args, actually.

I'm glad to hear it works for you now!

julien-h2 commented 2 months ago

As a side note, I'd be in favor of keeping it. Good production-ready defaults are great!