-
Notifications
You must be signed in to change notification settings - Fork 18
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
feature: report an error if -race is not working #169
Comments
I'll look into this, thank you! I think just in general that if there's any error when attempting to run a test, there should be a more clear notification/log with the error. About using |
Yes to use -race you must have cgo enabled and on non-Darwin systems have C compiler as per go docs You can see an error message that cgo must be enabled if you do Also this is not strictly related to this issue, but error reporting in general can be improved. For example when trying to run a test that does not compile (syntax issue for example) it defaults to returning a generic tests were skipped message: |
Yes, 100% agreed. I've thought about this many times myself while using the plugin (I use it on a daily basis). But just to confirm then, this really isn't limited to |
Sure, I just noticed the -race thing first. I think if you were to output the text from go test to neotest ouptut on non-zero code and mark the test as failed it would solve all of the above. |
Ok, this was actually a little tricky... but if you have the time, please give #176 a try by defining the branch in the plugin options: {
"fredrikaverpil/neotest-golang",
branch = "output-on-failure",
}, |
Did you check docs and existing issues?
Is your feature request related to a problem? Please describe.
Hey,
creating this feature request in case somebody will face the same in the future.
If cgo is not enabled/available then with default configuration tests will be skipped silently with not much help in the logs to narrow down the issue.
In my particular case I am using NixOS and did not had gcc package installed that's required for cgo to work. More about it: Using cgo on NixOS
To easily reproduce you can:
CGO_ENABLED=0 nvim
anyways, thanks for your work on the plugin!
Describe the solution you'd like to see.
Race flag should probably not be enabled by default or at least return an error if it fails, currently the only issue that can be seen is exit code 2 in the debug logs.
Describe alternatives you've considered.
If race kept as default might be nice to have information about it in the readme that it might be the reason tests are failing silently.
Additional context
No response
The text was updated successfully, but these errors were encountered: