Skip to content
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

API to merge multiple positions into a single test command? #212

Closed
mrcjkb opened this issue Feb 27, 2023 · 2 comments
Closed

API to merge multiple positions into a single test command? #212

mrcjkb opened this issue Feb 27, 2023 · 2 comments

Comments

@mrcjkb
Copy link
Contributor

mrcjkb commented Feb 27, 2023

If multiple positions are found (e.g. when calling neotest.run.run(vim.api.nvim_buf_get_name(0)), the adapter's build_spec will be called once for each position, resulting in separate processes for each one.

This can be an issue for Cabal (see mrcjkb/neotest-haskell#45).

Hspec has the ability to filter for multiple positions at once, so multiple test positions could be run at the same time.

Is there a way to implement this in an adapter with the current Neotest API? If not, would it be feasible to implement such an API?

A (less efficient, but probably easier to implement) alternative would be to prevent multiple processes from being run concurrently.

@rcarriga
Copy link
Collaborator

Neotest already allows adapters to specify single commands for groups of tests, the reason multiple commands are being run is because the adapter doesn't support running any position type other than "test" types https://github.com/mrcjkb/neotest-haskell/blob/master/lua/neotest-haskell/init.lua#L46-L48. Neotest will automatically try to break up groups of tests https://github.com/rcarriga/neotest/blob/0d17889ce740c83c18577487498a1a8fea144b0b/lua/neotest/client/runner.lua#L77-L82

@mrcjkb
Copy link
Contributor Author

mrcjkb commented Feb 27, 2023

That's great. Thanks for the info 🙏

@mrcjkb mrcjkb closed this as completed Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants