notomo / vusted

A busted wrapper for testing neovim plugin

Home Page:https://luarocks.org/modules/notomo/vusted

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to run vusted command

hrsh7th opened this issue · comments

I don't know the reason but I couldn't run vusted command in my environment.

My luarocks configuration is the following. I think it relates to this problem.

If you have no idea, feel free to close this issue. I will investigate it.

Configuration:
   Lua:
      Version    : 5.4
      Interpreter: /usr/local/opt/lua/bin/lua5.4 (ok)
      LUA_DIR    : /usr/local/opt/lua (ok)
      LUA_BINDIR : /usr/local/opt/lua/bin (ok)
      LUA_INCDIR : /usr/local/opt/lua/include/lua5.4 (ok)
      LUA_LIBDIR : /usr/local/opt/lua/lib (ok)

   Configuration files:
      System  : /usr/local/etc/luarocks/config-5.4.lua (ok)
      User    : /Users/***/.luarocks/config-5.4.lua (not found)

   Rocks trees in use:
      /Users/***/.luarocks ("user")
      /usr/local ("system")

Error messages are the following.

***:~ *** $ vusted
12 more lines
/usr/local/bin/vusted_entry.vim, line 9
Vim(lua):E5108: Error executing lua [string ":lua"]:1: module 'vusted/run' not found:
        no field package.preload['vusted/run']
        no file './vusted/run.lua'
        no file '/Users/***/Develop/Repos/neovim/.deps/usr/share/luajit-2.1.0-beta3/vusted/run.lua'
        no file '/usr/local/share/lua/5.1/vusted/run.lua'
        no file '/usr/local/share/lua/5.1/vusted/run/init.lua'
        no file '/Users/***/Develop/Repos/neovim/.deps/usr/share/lua/5.1/vusted/run.lua'
        no file '/Users/***/Develop/Repos/neovim/.deps/usr/share/lua/5.1/vusted/run/init.lua'
        no file './vusted/run.so'
        no file '/usr/local/lib/lua/5.1/vusted/run.so'
        no file '/Users/***/Develop/Repos/neovim/.deps/usr/lib/lua/5.1/vusted/run.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'

I found a cause.

The vusted comman will be created in /usr/local/bin/vusted and it is not a symlink so vusted_entry.vim does not detect vusted directory.

I will create PR maybe.

Thanks for investigation!
I reproduced it.
(I always seem to export LUA_PATH and LUA_CPATH in .bash_profile to require luarocks modules.)

$ luarocks which vusted.run
/home/notomo/.local/share/lua/5.1/vusted/run.lua
(provided by vusted 1.0.2-1)
luarocks show vusted
$ luarocks show vusted

vusted 1.0.2-1 - `busted` wrapper for testing neovim plugin



License:        MIT <http://opensource.org/licenses/MIT>
Homepage:       https://github.com/notomo/vusted
Installed in:   /home/notomo/.local

Commands:
        /home/notomo/.local/bin/vusted (/home/notomo/.local/bin/home/notomo/.local/bin/vusted)
        /home/notomo/.local/bin/vusted.bat (/home/notomo/.local/bin/home/notomo/.local/bin/vusted.bat)
        /home/notomo/.local/bin/vusted_entry.vim (/home/notomo/.local/bin/home/notomo/.local/bin/vusted_entry.vim)

Modules:
        vusted.assert (/home/notomo/.local/share/lua/5.1/vusted/assert.lua)
        vusted.run (/home/notomo/.local/share/lua/5.1/vusted/run.lua)

Depends on:
        busted >= 2.0.0 (using 2.0.0-1)

Indirectly pulling:
        busted (using 2.0.0-1)
        dkjson (using 2.5-2)
        lua-term (using 0.7-1)
        lua_cliargs (using 3.0-2)
        luafilesystem (using 1.8.0-1)
        luassert (using 1.8.0-0)
        luasystem (using 0.2.1-0)
        mediator_lua (using 1.1.2-0)
        penlight (using 1.9.2-1)
        say (using 1.3-1)
$ vusted
12 more lines
/home/notomo/.local/bin/vusted_entry.vim, line 9
Vim(lua):E5108: Error executing lua [string ":lua"]:1: module 'vusted/run' not found:
        no field package.preload['vusted/run']
        no file './vusted/run.lua'
        no file '/home/runner/work/neovim/neovim/.deps/usr/share/luajit-2.1.0-beta3/vusted/run.lua'
        no file '/usr/local/share/lua/5.1/vusted/run.lua'
        no file '/usr/local/share/lua/5.1/vusted/run/init.lua'
        no file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/vusted/run.lua'
        no file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/vusted/run/init.lua'
        no file './vusted/run.so'
        no file '/usr/local/lib/lua/5.1/vusted/run.so'
        no file '/home/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/vusted/run.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'%

$ export LUA_PATH="$HOME/.local/share/lua/5.1/?.lua;$HOME/.local/share/lua/5.1/?/init.lua"

$ export LUA_CPATH="$HOME/.local/lib/lua/5.1/?.so"

$ vusted
ok 1 - close_left() does nothing if there is no left tab
...

But I'm not familiar with luarocks.
So I don't know whether it should deal lua_path, lua_cpath in vusted.
Welcome your PR if you'd like!