nvim-neotest / neotest-go

MIT License
124 stars 43 forks source link

Cannot run spec tests #62

Open lawrence-laz opened 9 months ago

lawrence-laz commented 9 months ago

Hi, I tried running plenary spec tests but all of them failed. Seems like the test cannot find plugin dependencies. Here's a screenshot:

image

What am I doing wrong?

sergii4 commented 9 months ago

To be honest, I have no idea what's going on. Minimal config to reproduce as well as steps would be really helpful. Without it there is no point to discuss it. Moreover, I am not sure it's a plugin issue

lawrence-laz commented 9 months ago

I mean I was trying to run tests in this repo: Input:

git clone https://github.com/nvim-neotest/neotest-go.git
cd neotest-go
nvim --headless -c "PlenaryBustedDirectory lua/spec/neotest-go { }" || echo "some tests failed"

Output:

Starting...Scheduling: lua/spec/neotest-go/init_spec.lua
Scheduling: lua/spec/neotest-go/utils_spec.lua
some tests failed

The test fails because it cannot find nio package (can be seen in the screenshot above), although :lua =require'nio' executes and finds the said package without problems.

I've also read that plenary test harness runs tests in a separate nvim instance without plugins by default? So that's probably the issue I'm facing. I assume that I am running these tests incorrectly.

How do you execute tests in neotest-go/lua/spec/neotest-go/init_spec.lua from this repo?

jstensland commented 7 months ago

I was able to run them with

nvim --headless -c ':PlenaryBustedDirectory lua/spec'

and this was recently added to the README. Your command also works for me though, fwiw.

But... I did hit this nio issue too actually, but I can't for the life of me remember what change fixed it, and I was new to setting up any plenary busted tests at all. I'll post back if I can repro that previous failure