lua
lua copied to clipboard
There should be a guide on how to set up unit test debugging on the 'tracks/lua/resources' page.
This page should include a guide on how to set up unit test debugging. I got by without this until I hit the custom-set
exercise, in which case it would just be massively tedious to recreate the tests in code inside your module. I find a long or awkward process of setting up your dev enviroment to be quite demotivating, and I am sure there are many that would not have gone through the day and a half process it took me to get this set up.
I wrote up a how-to on the forum, it's a little confusingly written so I could rewrite with simplified instructions, if this is a useful idea. I could also go through the linux setup, but I do not have a mac so I would need someone else to do that part.
https://forum.exercism.org/t/how-to-debug-busted-unit-tests-in-vscode/8560
Hello. Thanks for opening an issue on Exercism 🙂
At Exercism we use our Community Forum, not GitHub issues, as the primary place for discussion. That allows maintainers and contributors from across Exercism's ecosystem to discuss your problems/ideas/suggestions without them having to subscribe to hundreds of repositories.
This issue will be automatically closed. Please use this link to copy your GitHub Issue into a new topic on the forum, where we look forward to chatting with you!
If you're interested in learning more about this auto-responder, please read this blog post.
Ok that's annoying. I suppose I will just make a PR instead.
Please do, thanks!
ok @ryanplusplus I wrote this up and tested on win 10 and ubuntu 20.04. Where should it be located though? My current draft is written in markup FWIW:
https://gist.github.com/edzillion/8cf275d68fbba92dd1d4a028a6ca1171
edit: I notice that with this solution it seems that busted has issues capturing returned errors. The tests fail at that point and print an error to the debug console. For example in the nucleotide count exercise where tests expect the return of an error with a certain error message. I was able to pass these tests using busted on the command line.
I thought I remembered a setting somewhere where you can set what types of exceptions to stop on but I can't find it right now.
Hi, thanks for creating this guide :)
I would suggest to put it in docs/TESTS.md under a new headline like "Debugging unit tests" or something like this.
I just saw that the README of Local Lua Debugger says it support Lua 5.1-5.3 and JIT. I would suggest to mention this also in the guide.
I just saw that the README of Local Lua Debugger says it support Lua 5.1-5.3 and JIT. I would suggest to mention this also in the guide.
Perhaps ... I hesitate because I have been using it just fine with 5.4 and I wonder has it just not been tested with that version? I say that because the author of that plugin has stated that he does not have a lot of time to support the plugin. In the interests of keeping thing simple I might just avoid stating compatibility at all.
This looks great, thanks!
Great. I guess the obvious next suggestion is whether to put those debug lines to the top of each test_spec.lua
file?
if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
require("lldebugger").start()
end
Great. I guess the obvious next suggestion is whether to put those debug lines to the top of each
test_spec.lua
file?if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then require("lldebugger").start() end
I think that might look intimidating to someone who's just getting started, but I'd like to hear feedback from others.
I don't know exercism, but regarding local-lua-debugger you might can and want to adapt the launch.json from my current project: /.vscode/launch.json