-
Notifications
You must be signed in to change notification settings - Fork 5
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
Run more than a single test at once #45
Comments
I think the error originates from spawning too many I've tried to fix this myself a couple months back, but I've gotten a bit frustrated with figuring out how to generate just one |
Thanks for reporting this. You're probably right about neotest spawning too many cabal processes. I haven't used this on whole test files very often - I usually call When running on the entire file, neotest will identify child and parent nodes as separate tests, leading to duplicate test runs of the child nodes. I have also noticed some strange behaviour when the cursor position results in multiple nodes being identified, which indicates multiple processes are being started. To fix this, we need a way to identify child nodes as such and remove them if their parent is in the list of tests to run. For running tests on whole files, it should be possible to use a different tree-sitter query for finding tests, based on whether or not a file was passed as an argument. I'm quite busy until next weekend, but maybe I'll be able to squeeze in some time tomorrow. |
Don't stress yourself. This isn't urgent. :-) Since it might help, I share what I can still remember the last time I tried to fix this.
|
Thanks for the input.
The adapter interface and RunSpec type make me think otherwise.
This is probably the way to go if we can get the |
After having browsed the neotest sources a bit, I think the best way to solve this is a complete rework of how neotest-haskell parses positions and later constructs the test commands from the positions. The current If I change It would still be nice to be able to merge multiple positions into a single command, but this will definitely need a patch to neotest. |
@saep I have implemented a fix and created a separate issue #49 for improving the logic to parse positions (which will need more time). The fix in #48 attempts to find the top-level I'll have to take some extra time to think about how to get that working. Adding a When #44 is merged, I will prepare a new release 😄 |
Neovim version (nvim -v)
v0.8.3
Operating system/version
NixOS 22.11 / NixOS unstable with home-manager
How to reproduce the issue
Open a file with multiple tests (e.g. https://github.com/neovimhaskell/nvim-hs/blob/main/tests/EventSubscriptionSpec.hs).
Run all tests of a file with multiple tests:
Expected behaviour
Tests execute without errors.
Actual behaviour
Some tests usually fail with a failure message such as this:
The minimal config used to reproduce this issue.
Basically:
I tried to use the minimal config from this repository with the lines above added, but it cannot find tests. I don't know why. The 2 lines above is the only neotest configuration I have.
The text was updated successfully, but these errors were encountered: