-
Notifications
You must be signed in to change notification settings - Fork 2
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
Help with busted, local-lua config 🙏 #17
Comments
Thanks for the kind words, I'm glad people find it useful 🙂 the adapter is still under development so it really helps when people submit an issue. FYI, the
Hope that helps 🙂 |
It certainly helps to see your config and get a sanity check. Enjoying neotest ✅
* neotest-busted ~
- OK has neovim 0.9.0+
- OK `neotest` is installed
- OK `nio` is installed
- OK found no errors in config
- OK found `busted` (type: config) at
/usr/local/bin/busted
<SNR>97_try_cmd returning ['LUAROCKS_SYSCONFDIR=''/usr/local/etc.../busted/2.2.0-1/bin/busted'' "$@"', '']
calling <SNR>97_try_cmd
<SNR>97_try_cmd returning ['LUAROCKS_SYSCONFDIR=''/usr/local/etc.../busted/2.2.0-1/bin/busted'' "$@"', '']
calling <SNR>97_try_cmd
<SNR>97_try_cmd returning ['LUAROCKS_SYSCONFDIR=''/usr/local/etc.../busted/2.2.0-1/bin/busted'' "$@"', '']
calling <SNR>97_try_cmd
<SNR>97_try_cmd returning ['_']
calling <SNR>97_try_cmd
<SNR>97_try_cmd returning ['_']
calling <SNR>97_try_cmd
<SNR>97_try_cmd returning ['_']
calling <SNR>97_try_cmd
<SNR>97_try_cmd returning ['_']
LUAROCKS_SYSCONFDIR='/usr/local/etc/luarocks' exec '/usr/bin/lua5.1' -e 'package.path="/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;"..package.path;package.cpath="/usr/local/lib/lua/5.1/?.so;"..package.cpath;local k,l,_=pcall(require,"luarocks.loader") _=k and l.add_context("busted","2.2.0-1")' '/usr/local/lib/luarocks/rocks-5.1/busted/2.2.0-1/bin/busted' "$@" *edit - Command info from vim.inspect {
arguments = { "--headless", "-i", "NONE", "-n", "-u", "NONE", "-c", "lua package.path = 'lua/?.lua;lua/?/init.lua;' .. package.path", "-l", "/usr/local/bin/busted", "--verbose", "--output", "/home/aaron/.local/share/nvim/lazy/neotest-busted/lua/neotest-busted/output_handler.lua", "-Xoutput", "/tmp/nvim.aaron/XW7ip6/4.json", "--filter", '"Hello test some other test"', '"/home/aaron/plugins/myplugin/tests/test_spec.lua"', '"--helper"', '"/home/aaron/.local/share/nvim/lazy/neotest-busted/lua/neotest-busted/start_debug.lua"' },
cpaths = {},
nvim_command = "/usr/bin/nvim",
paths = { "lua/?.lua", "lua/?/init.lua" }
} That's pretty much what I thought as well. I will try these steps and get back. The voice in my head says "it's a path somewhere.. it's always a path!!" Thanks again |
Thanks for providing the additional info.
I don't have a single line in my logs (710886 lines) that mention the
Everything looks as expected and properly quoted (which might otherwise have meant that a '-' got misinterpreted) and nice that you can run it in the CLI.
I noticed that the additional Do you have an installation in |
Thanks @MisanthropicBit for the info and ideas. Seems like it will take me some time to step through the config combinations and get back. Feel free to close if you need to until then 👍 |
No problem 🙂 Let's keep this issue open for now until it's confirmed whether this is a bug in neotest-busted, a new feature is needed, or something else. I've added a warning box about the consequences of setting |
Hey @aaharr. Did you get a chance to look at the config combinations? |
@MisanthropicBit No.. my Lua flow has been pretty ad hoc. I'm not sure when I'll finally get to TDD my half-finished plugins 🥲 |
No worries, just wanted to follow up on it 🙂 |
Hi, guys! A workaround is to set |
Hi @YaroSpace. Thanks for providing some new information.
I missed this in OP's post but I think this actually fails because it is trying to parse a shell script as a lua file as neotest-busted internally runs
Do you mean just running I didn't know busted very well when I started out so this was the avenue I pursued. No reason particularly except that I read about neovim new
A better way would be to just let neotest-busted find the executable lua script for you which is the default as is stated in the README. Perhaps I need to make this clearer. Note that setting I don't recognise that particular path though. How did you install busted and on what system? I may need to add support for multiple paths on different systems (I'm on mac). Any other feedback on making it easier to set up neotest-busted is most welcome since I'm planning on officially "releasing" it soon 🙂 |
I have installed busted with luarocks, globally. In |
Btw, thank you for the great work. I spent some time getting familliar with the internals - your code is a pleasure to read.
|
Good point. I haven’t actually tested the global option since I personally use a per-user luarocks installation so I’ll make a fix for it.
Thanks 🙂 that’s very kind of you to say and very motivating. I feel like I’ve already spent quite a bit of time on this project 😅 so I’m happy to hear it.
|
Such identifiers are formed with the same quotes that are actually used in |
|
Makes sense. Especially since I have Would you mind opening a separate issue(s)? Sounds like you are making PRs for the issues below? Just so we do not duplicate work.
|
These are the various options for pending:
|
Let me open a PR with all the changes I have made to the fork of your repo, so we can comment/cherry pick next to the actual code there and then you can either add the suggestions or I will make a proper PR. |
Thanks for clarifying pending tests. That should definitely be supported. Sounds good 🙂 FYI, I’ve already started on a few of the issues and opened PRs for them. |
Very much appreciate you targeting this use case (💯)
When I try to run busted tests, I get syntax errors seemingly from the busted executable. Just the sample busted test from the plenary docs, passes when running busted either via plenary or lua. Would love to be able to debug!
For every test:
E5112: Error while creating lua chunk: /usr/local/bin/busted:3: unexpected symbol near '-'
File is called test_spec.lua and there is an empty minimum_init.spec in the same directory. Plenary seems to be picking it up, but only since I named it test_spec.lua.
Hoping something jumps out at you!
The text was updated successfully, but these errors were encountered: