Open sparr opened 2 months ago
3rd/luamake/luamake test
is not the way to run the test. From the readme here: https://github.com/actboy168/luamake/blob/master/README.md#commands
luamake test
Equivalent toluamake lua test.lua
which is just running any lua file (in this case test.lua
) in your current directory (i.e. the test.lua
in luals repo's root).
But this file should not be run by luamake
, it should be run by the ./bin/lua-language-server
binary. You can verify this by looking into the launch.json
: https://github.com/LuaLS/lua-language-server/blob/66141703b3dcd3c94d815ab275638cad443e0dd8/.vscode/launch.json#L6-L11
bin/lua-language-server
to run the test.lua
=> ./bin/lua-language-server test.lua
3rd/luamake/luamake
(without any arguments), it can skip the build and run the tests directly π . Just like between a normal make
and make --always-make
In any case, I think the readme of luals should be updated to reflect this. π€ Or need to request some change to luals's wiki page repo: https://github.com/LuaLS/LuaLS.github.io
Seems I have some misunderstanding on this π , I do found a test
command inside 3rd/luamake
: https://github.com/actboy168/luamake/blob/master/scripts/command/test.lua
Maybe really luamake test
isn't working properly π€
Thanks for the insights. Running luamake
on its own runs the bee tests and the test.lua tests, which is useful. And bin/lua-language-server test.lua
runs the test.lua tests as well. These will certainly help me test things faster. If no one comes up with an explanation or fix for using luamake to run test.lua when I'll PR a change to the README soon.
Some further analysis, I think the make.lua
is used when invoking 3rd/luamake/luamake
π
Makefile
and specifies extra targets that can be accepted by luamake
https://github.com/LuaLS/lua-language-server/blob/66141703b3dcd3c94d815ab275638cad443e0dd8/make.lua#L95-L121default
target is to execute a unit-test
target, which in turns executes both the run-bee-test
and run-unit-test
rule using $bin/lua-language-server
as configuredluamake
on its own will run the tests. And if you want to use an argument (say for verbosity), you can run luamake unit-test
=> I tested and it will trigger the same tests as well πluamake test
is completely another thing, it's a luamake
command that runs a test.lua
directly. (just like build
/ rebuild
, which are commands of luamake
). I guess it assumes the test.lua
is some generic lua script without dependencies. But it's not the case in luals because the test.lua
depends on some specific require paths that set by bin/lua-language-server
itself, so it cannot be run by luamake
directly
=> need to wrap it as a unit-test
rule, as done in the current make.lua
configuration
luamake
alone will also do a build if your code has changed or you did luamake clean
previously. It seems like the contents of make.lua
provide additional instructions for luamake
, but it also provides some of its own functionality such as building by default and taking the rebuild
parameter.
So, it seems like luamake unit-test
is what I was looking for. Thanks! I'll keep this issue open until I or someone else PR's an update to the docs.
How are you using the lua-language-server?
Command Line
Which OS are you using?
MacOS
What is the issue affecting?
Other
Expected Behaviour
luamake test
runs the same tests with the same results asluamake rebuild
Actual Behaviour
luamake rebuild
works.luamake test
can't find packages:Updating
package.path
to point to the log module leads to another failed package load, then multiple additions topackage.path
to find more modules, eventually leading to needing to compile lpeglabel.so manually, then a dead end when I couldn't figure out how to resolve this one (note the new paths being searched from all the additions I made topackage.path
to get this far)Reproduction steps
3rd/luamake/luamake rebuild
3rd/luamake/luamake test
Additional Notes
No response
Log File
No response