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

fix: allow terminating tests run through dap strategy #350

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

Quitlox
Copy link
Contributor

@Quitlox Quitlox commented Jan 24, 2024

Currently, it is not possible to stop a test running through the debug strategy (by calling require("neotest").run.stop().

This results in the following error:

E5108: Error executing lua: ...quitlox/.local/share/nvim/lazy/neotest/lua/nio/tasks.lua:95: Async task failed without callback: Th
e coroutine failed with this message:                                                                                             
...nvim/lazy/neotest/lua/neotest/client/strategies/init.lua:66: attempt to call field 'stop' (a nil value)                        
stack traceback:                                                                                                                  
        ...nvim/lazy/neotest/lua/neotest/client/strategies/init.lua: in function 'stop'                                           
        ...al/share/nvim/lazy/neotest/lua/neotest/client/runner.lua:205: in function 'stop'                                       
        ...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:123: in function 'stop'                                       
        ...al/share/nvim/lazy/neotest/lua/neotest/consumers/run.lua:148: in function 'func'                                       
        ...quitlox/.local/share/nvim/lazy/neotest/lua/nio/tasks.lua:168: in function <...quitlox/.local/share/nvim/lazy/neotest/lu
a/nio/tasks.lua:167>                                                                                                              
stack traceback:                                                                                                                  
        [C]: in function 'error'                                                                                                  
        ...quitlox/.local/share/nvim/lazy/neotest/lua/nio/tasks.lua:95: in function 'close_task'                                  
        ...quitlox/.local/share/nvim/lazy/neotest/lua/nio/tasks.lua:117: in function 'step'                                       
        ...quitlox/.local/share/nvim/lazy/neotest/lua/nio/tasks.lua:145: in function 'stop'                                       
        ...itlox/.config/nvim/lua/quitlox/plugins/ide/test/init.lua:30: in function <...itlox/.config/nvim/lua/quitlox/plugins/ide
/test/init.lua:30>  

This PR adds the stop method to the dap strategy.

@rcarriga
Copy link
Collaborator

Awesome thank you!

@rcarriga rcarriga merged commit 73043d6 into nvim-neotest:master Jan 25, 2024
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

Successfully merging this pull request may close these issues.

2 participants