Support for running tests using bazel #187
Replies: 2 comments 10 replies
-
Hi @rajneesh2k10, I haven't used Bazel myself so I am not aware of how it works - but I'd be happy to have support in neotest-golang for it. There's no out-of-the-box or formal support for extending the adapter with test runners, so we would have to extend the adapter a little bit. Just like you have noticed, I'm actually using I like your idea of hooking into the neotest-golang code with your custom test runner executable with potentially custom logic for the test command/args etc. Such efforts could perhaps also cater for the request/question in #186 which talks about extending functionality of how to provide custom arguments to Some pointers on getting startedI would personally like to make test runners a "first class citizen" in the codebase. Meaning; refactoring a little bit so that if-statements are not scattered around in the code like; I would suggest adding new "elseif"-clauses where you can currently see how I am checking whether you intend to run When it comes to test command output, I currently have one unified way of expecting I would also recommend you enable debug logging, so that you can more easily inspect the test commands produced etc. Finally, we need to write the final code so it's testable. Since I'm not using bazel myself, I want to make sure I'm not going to break this functionality for someone without noticing. But that can come later once we have a proof of concept. Let me know if you need any additional help or if you get stuck - and I'll start thinking of how we can restructure the code a bit so to make test runners more of a "first class citizen" feature. 😄 EDIT: hmmm... it looks like Bazel indeed does not output the same way |
Beta Was this translation helpful? Give feedback.
-
@rajneesh2k10 I just noticed there's a new neotest-bazel project: https://github.com/sluongng/neotest-bazel 😄 Regardless, I'll continue to refactor neotest-golang so to support custom runners which would like to provide their own test command and output parsing. |
Beta Was this translation helpful? Give feedback.
-
Bazel Ref: https://bazel.build/versions/6.3.0/run/build
Thank you for building this adapter.
My project uses Bazel for building and running tests in the project. I am looking at neotest-golang adapter if it can provide me the ability to specify the test runner commands for test execution.
Skimming through the neotest-golang plugin code, I came across code that attempts to find the test runner executable. However, in the configuration (Readme), I didn't see any option to provide a custom executable name.
I am wondering if it's possible to use a different runner out-of-the-box? Or, will I need to extend this plugin? Or, is the plugin not build for extending to new runners?
If I can extend the plugin for new runners, any pointers will be helpful.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions