rouge8/neotest-rust

running the whole test suite

Closed this issue ยท 9 comments

I thought I'd give it a shot to implement running the whole test suite, but I don't find a good entry point. I was wondering if you could give me a hint if you already know where the problem is?

For clarification, I am talking about require("neotest").run.run(vim.fn.getcwd()) returning No tests found.

I'm not sure, sorry, I haven't really thought about it.

Can you maybe help explain a bit how this all connects though? I wasn't sure if it's a problem of the discovery process and that it just doesn't return any positions when given the root or if it's some other problem.

I think this issue is resolved now with the latest commit. I've just tried running the command in my rust project and it seemed to work. Have you tried it in yours?

When I run it on tests in jan-xyz/adventofcode/2021 I get

Run All Tests
command: require("neotest").run.run(vim.fn.getcwd())
output:

neotest-rust: ...pack/packer/start/neotest-rust/lua/neotest-rust/init.lua:129: attempt to concatenate a nil value

Run Nearest Test
command: require("neotest").run.run() on a test
output:

Error executing vim.schedule lua callback: ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: ...acker/start/plenary.nvim/lua/plenary/context_manager.lua:47: /var/fol
ders/95/81xzw3_50djfylhvphkc2xhw0000gn/T/nvim.jan/xI2Axp/13.junit.xml: No such file or directory                                                                                                                           
stack traceback:                                                                                                                                                                                                           
        [C]: in function 'error'                                                                                                                                                                                           
        ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'                                                                                                                     
        ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:45: in function <...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:44>   

Run All Tests in File
command: require("neotest").run.run(vim.fn.expand("%"))
output:

Error executing vim.schedule lua callback: ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: ...acker/start/plenary.nvim/lua/plenary/context_manager.lua:47: /var/fol
ders/95/81xzw3_50djfylhvphkc2xhw0000gn/T/nvim.jan/xI2Axp/10.junit.xml: No such file or directory                                                                                                                           
stack traceback:                                                                                                                                                                                                           
        [C]: in function 'error'                                                                                                                                                                                           
        ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'                                                                                                                     
        ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:45: in function <...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:44>

That folder isn't a cargo project so I'm not surprised it doesn't work. Running it in the subfolders (the cargo projects) works on my machine

hmmm good point, I'm used to be able to run tests from the root of the repository, but true, it's a bit different for that repo.

However, I get the same errors even when I'm in adventofcode/2021/7/ which is a cargo project root.

I've just tried that folder on my machine and it works on my machine. Does cargo nextest run work on your machine?

๐Ÿ™ˆ๐Ÿ™ˆ๐Ÿ™ˆ๐Ÿ™ˆ๐Ÿ™ˆ whoops. I reinstalled my machine and forgot to install nextest ๐Ÿ’ฉ it works now. Thank you for your patience.