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

Cannot run spec tests #62

Open
lawrence-laz opened this issue Oct 2, 2023 · 3 comments
Open

Cannot run spec tests #62

lawrence-laz opened this issue Oct 2, 2023 · 3 comments

Comments

@lawrence-laz
Copy link

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
Copy link
Collaborator

sergii4 commented Oct 2, 2023

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
Copy link
Author

lawrence-laz commented Oct 2, 2023

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
Copy link
Contributor

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

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

3 participants