-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
Perpetually scheduling tests #474
Comments
I have the same issue, but have installed plenary via home-manager in nixos. I thought my issue was related to what i saw in #319, so I posted there, but I'm not sure about that anymore. |
As workaround/more clean test environment, you can add tests/minimal.lua with vim.opt.rtp:append(".")
vim.opt.rtp:append("../plenary.nvim")
vim.cmd.runtime { "plugin/plenary.vim", bang = true } and use |
Probably the same problem appears on using local add_cmd = vim.api.nvim_create_user_command
add_cmd('CheckLua', function()
local os_env_path = os.getenv 'PATH'
local tests_run = plenary.job:new({ command = 'nvim', args = { '--headless', '--noplugin', '-u', 'tests/minimal.lua', '-c', [["PlenaryBustedDirectory tests/ {minimal_init = 'tests/minimal.lua'}"]] }, env = { ["PATH"] = os_env_path } })
tests_run:sync()
print(vim.inspect.inspect(tests_run:result()))
end, {})
From cli it just works with
|
I faced freezing tests in my project. There you can find minimal.lua for lazy.nvim. Missing dependencies caused the problem. I have |
A simpler reproduction only with rg: local job = Job:new {
command = "rg",
args = { "test" }, -- does not work
}
job:sync() Must run this in a subdir, not $HOME. Then it makes no difference with UPDATE: Looks like ripgrep is unable to get the correct cwd and might default to $HOME. Might be the same cause here, that cwd is not set: local job = Job:new {
command = "rg",
args = { "test", "." }, -- works
}
job:sync() Adding |
I just checked my own tests and I'm pretty sure all of my |
I think this was an issue with not properly setting up lazy within the unit tests; this fix worked for me (I took the config from one of folke's plugins, but I don't remember which). |
Hi there, I recently switched over to
lazy.nvim
for package management (which I suspect is the reason), and now myplenary
test suite no longer runs. Here's the output for the testing window:And I've been using this command to trigger it (it just runs the tests on the correct folder, as long as you're in the git project):
Any advice would be greatly appreciated (
plenary
is loaded in when I trigger this keymap; I tried both lazy-loading with telescope as well as forcing it to load on startup, but neither resolved the issue).It appears that the regular
<Plug>PlenaryTestFile
still works for individual files though.The text was updated successfully, but these errors were encountered: