Closed polirritmico closed 1 month ago
Hi again @polirritmico. Thanks for submitting another issue and providing a detailed description. Really helps with debugging! 🙂
I'm currently on holiday and away from my computer. I'll be home next week where I can try your repro and provide more help.
A few things regarding the errors etc.
pl.path
indicates that there are missing/incorrect paths set up for busted. IIRC, busted depends on the penlight library which is packaged as a shared library (.so on your system). If I'm correct, you'll need to set up busted_cpaths
in the config as well.runner.lua
is not executable which is correct since it's just a lua source file. The command you are looking for is an executable file called busted
in your local luarocks installation directory.--busted
does this?) then you shouldn't need to specify busted_command
and busted_paths
as neotest-busted will automatically first look for a local installation and then a user (home-directory) and finally a global installation. The two latter installations are only searched for if local_luarocks_only
is false
.Hope that helps for now.
Hi. Thanks for the info. Finally I was able to get things running. I had to:
#!/usr/bin/env -S nvim -l
Remote = false
vim.env.LAZY_STDPATH = ".tests"
local url = "https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"
if Remote then
load(vim.fn.system("curl -s " .. url))()
else
local bootstrap = ".tests/bootstrap.lua"
if not vim.uv.fs_stat(bootstrap) then
vim.fn.mkdir(vim.fs.dirname(bootstrap), "p")
vim.fn.system("curl -s " .. url .. " -o " .. bootstrap)
end
loadfile(bootstrap)()
end
-- Setup lazy.nvim
require("lazy.minit").busted({
spec = {},
})
$ rm -rf .tests
require("neotest-busted")({
busted_command = ".tests/data/nvim/lazy/busted/bin/busted",
minimal_init = "tests/busted.lua",
local_luarocks_only = true,
}),
$ nvim -l tests/minit.lua tests
Thanks for the help!
Did you check docs and existing issues?
log_level
tovim.log.levels.debug
inneotest.setup
and examined the logs.Neovim version (nvim -v)
NVIM v0.10.2 Build type: Release LuaJIT 2.1.1716656478
Operating system/version
Gentoo Linux 2.15, kernel 6.6.52-gentoo (64 bits)
Describe the bug
Hi, I've been following this project from some time but I still can't get things working, most probably I'm setting something wrong. I don't know if this is possible at the current plugin state, but I want to use a local busted installed through a lazy.nvim bootstrap. This is my
neotest
config:But I'm getting not found modules errors when executing the tests:
Also I got an error message complaining about a missing json test output (check the
neotest.log
).Running the tests with:
nvim --clean -l tests/minit.lua --busted tests -o utfTerminal
work without any problem. I've made this repo to provide the minimal environment. Check the reproduction steps.Expected Behavior
Found all the busted modules installed inside
.tests/data/nvim
path and run the tests through neotest without problems.Output of
:checkhealth neotest-busted
if relevantGot this error:
But fixing that changing the
runner.lua
execution permissions only fix the checkhealth check:neotest log output if relevant
Steps To Reproduce
repro.lua
file to an empty directory.repro.lua
file through nvim:nvim -u repro.lua
and exit nvim.foo.nvim
, run the tests through the bootstrap:cd foo.nvim
,nvim --clean -l tests/minit.lua --busted tests -o utfTerminal
cd ..
,nvim -u repro.lua
:lua require("neotest").run.run(vim.fn.expand("%"))
Don't know if more info is needed.
Thanks!