-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken output when non-json lines occur #25
Comments
Any general build message is not logged out as json, but should still be included in the output. E.g. import cycle |
@Davincible do you have a solution in mind. FWIW AFAIK most go testing explodes if there is any error in the package so I view it not working with invalid code as normal. I wouldn't expect it to partially run since I don't think go supports that, happy to be corrected if there is a non overly complex way to do that. Essentially, if there is no valid json then you can't really call any of the parsing functions since they expect json. I guess you'd need some other mechanism to pass the output string to neotest's output. Happy to review a PR 🤷🏿 |
I have the same issue, that when I run test, it show some warning so that neotest-go can not parse because it's invalid json,
But this will work fine: |
I believe this can be closed as this got merged: #54 |
The
go test -json
package has a tendency to include non-json output in some cases. For example when one (distant) sub-package doesn't compile. As a result of this, if I have one not-compiling file in my whole project, non of my tests will report as passing, even though they pass, and the log output will not be parsed.The problematic code is here;
neotest-go/lua/neotest-go/init.lua
Lines 220 to 226 in afb87c6
It happens because it now returns prematurely when one line has no valid json. We can either ignore the line here, or try to include it as is.
How do you want to handle this scenario? I can implement a fix
The text was updated successfully, but these errors were encountered: