Luarocks/busted setup on macOS #110
-
Hi @HiPhish, following this reddit thread, I'm attempting to just run the test suite locally on macOS, but I feel something is a little strange with my local setup, and I was thinking maybe you can spot what I'm doing wrong. I'm using pkgx to install lua and luarocks. I'm using a pkgx with the ability to set tooling on a per-project basis, but I think you can just achieve the similar result by doing this: brew install pkgxdev/made/pkgx
pkgx install luajit.org
pkgx install luarocks.org Then I install busted: # install and use luajit
luarocks --lua-dir=$HOME/.pkgx/luajit.org/v2.1.0 --lua-version=5.1 install busted
# make busted available on path
PATH=$PATH:$HOME/.luarocks/bin
# set LUA_PATH
luarocks --lua-dir=$HOME/.pkgx/luajit.org/v2.1.0 --local path Finally, I run the tests: make unit-test
✱
0 successes / 0 failures / 1 error / 0 pending : 0.000312 seconds
Error → ./test/unit/stack_spec.lua @ 1
suite ./test/unit/stack_spec.lua
./test/unit/stack_spec.lua:1: module 'rainbow-delimiters.stack' not found:
no field package.preload['rainbow-delimiters.stack']
no file './src/rainbow-delimiters/stack.lua'
no file './src/rainbow-delimiters/stack/rainbow-delimiters/stack.lua'
no file './src/rainbow-delimiters/stack/init.lua'
no file '/Users/fredrik/.pkgx/luarocks.org/v3.11.0/tbin/../share/lua/5.1/rainbow-delimiters/stack.lua'
no file '/Users/fredrik/.pkgx/luajit.org/v2.1.0/share/luajit-2.1/rainbow-delimiters/stack.lua'
no file '/Users/fredrik/.luarocks/share/lua/5.1/rainbow-delimiters/stack.lua'
no file '/Users/fredrik/.luarocks/share/lua/5.1/rainbow-delimiters/stack/init.lua'
no file '/Users/fredrik/.pkgx/luarocks.org/v3.11.0/share/lua/5.1/rainbow-delimiters/stack.lua'
no file '/Users/fredrik/.pkgx/luarocks.org/v3.11.0/share/lua/5.1/rainbow-delimiters/stack/init.lua'
no file './csrc/rainbow-delimiters/stack.so'
no file './csrc/rainbow-delimiters/stack/rainbow-delimiters/stack.so'
no file '/usr/local/lib/lua/5.1/rainbow-delimiters/stack.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file './rainbow-delimiters/stack.so'
no file '/Users/fredrik/.luarocks/lib/lua/5.1/rainbow-delimiters/stack.so'
no file '/Users/fredrik/.pkgx/luarocks.org/v3.11.0/lib/lua/5.1/rainbow-delimiters/stack.so'
no file './csrc/rainbow-delimiters.so'
no file './csrc/rainbow-delimiters/rainbow-delimiters.so'
no file '/usr/local/lib/lua/5.1/rainbow-delimiters.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file './rainbow-delimiters.so'
no file '/Users/fredrik/.luarocks/lib/lua/5.1/rainbow-delimiters.so'
no file '/Users/fredrik/.pkgx/luarocks.org/v3.11.0/lib/lua/5.1/rainbow-delimiters.so'
E5113: Error while calling lua chunk: [NULL]
make: *** [unit-test] Error 1 This is where I guess I have done something wrong...? If I just copy the project into a cp -r lua src
make unit-test
●●●●●●●●●●
10 successes / 0 failures / 0 errors / 0 pending : 0.002297 seconds I'm not super well adversed with lua/luarocks/busted, and so I'm not sure what is dictating these search paths. Any clue as to what I need to change? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
You have changed the Something in your setup is messing up the search paths where Neovim is looking for Lua modules. I will be out of town for the duration of the next week, so please don't be surprised if I don't respond until then. You can ping me here if I don't reply for a longer time. |
Beta Was this translation helpful? Give feedback.
-
Oh wait, what directory are you running the tests from? You need to be inside the plugin directory, neither above nor below it. Otherwise all the relative paths are wrong. There is a Another thing you can try is unsetting the |
Beta Was this translation helpful? Give feedback.
I'm not sure what I'm doing but by adding this to the
busted
wrapper, the tests are now found on my machine without resorting to renaming any directories, when I runmake unit-test
: