fredrikaverpil / neotest-golang

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

bug: neotest-golang shows WARN when there are build errors #218

Open abhipranay opened 2 days ago

abhipranay commented 2 days ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.10.0

Operating system/version

MacOS 14.7.1

Output from :checkhealth neotest-golang

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

Requirements ~
- OK Binary 'go' found on PATH: /opt/homebrew/bin/go
- OK Found go.mod file for 
- 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) ~
- OK Binary 'dlv' found on PATH: 
- OK dap is available
- OK dapui is available
- OK dap-go is available

Gotestsum (optional) ~
- OK Binary 'gotestsum' found on PATH: 
- Found gotestsum to be installed, but not set as test runner.

Describe the bug

I am using Lazyvim. Below warning message is shown if build fails due to come error during compilation.

WARN | 2024-11-19T22:32:17Z+0100 | .../nvim/lazy/neotest-golang/lua/neotest-golang/logging.lua:69 | [neotest-golang] Test(s) not associated (not found/executed):

On checking the logs further I found this might be due to go test non-json output on stdout during build failure. golang team already has this issue

Steps To Reproduce

  1. Write a test.
  2. Introduce some compilation error.
  3. Run tests.

Expected Behavior

Warning notification should not appear. Output should show build related errors in panel.

Your Lua setup

Default config.
fredrikaverpil commented 14 hours ago

Thanks @abhipranay for the report! I'm working on a fix in #219