neovim / go-client

Nvim Go client
https://pkg.go.dev/github.com/neovim/go-client
Apache License 2.0
565 stars 36 forks source link

Failures when running tests (e.g. for DeleteBuffer) #102

Closed slzatz closed 3 years ago

slzatz commented 3 years ago

I am relatively new to go and the go bindings for the nvim api but when I run go test I am getting a number of failures and separately in my own code I cannot run commands like DeleteBuffer(...) without getting the same error that I get when I run the tests, namely:

nvim:nvim_buf_delete exception: Invalid method: nvim_buf_delete

All the rest of the code I have written is working but just trying to figure out if this is my error or if a subset of methods like DeleteBuffer are not working. Seems impossible that this would have escaped notice, but just checking to see if there is a known issue before continuing to try to debug my code.

slzatz commented 3 years ago

Some additional info. Am running on a current version of Arch. The following all fail with the same Invalid method exception:

nvim_buf_delete
nvim_buf_set_text
nvim_exec
nvi m_exec_lua
nvim_set_hl
nvim_buf_set_extmark
nvim_get_runtime_file
nvim_get_all_options_info
nvim_get_option_info

In addition, when trying to detach a buffer (which I don't see a test for), I am getting:

msgpack/rpc: notification service method nvim_buf_detach_event not found

If someone can point me in the right direction, happy to investigate.

zchee commented 3 years ago

@slzatz Thanks for post issue. will investigate.

zchee commented 3 years ago

@slzatz What nvim version are you using?

slzatz commented 3 years ago

NVIM v0.4.4

slzatz commented 3 years ago

Here is the -v output:

    1 === RUN   TestDecodeExt
    2 --- PASS: TestDecodeExt (0.00s)
    3 === RUN   TestEncodeExt
    4 --- PASS: TestEncodeExt (0.00s)
    5 === RUN   TestBufferReader
    6 --- PASS: TestBufferReader (0.01s)
    7 === RUN   TestAPI
    8 === PAUSE TestAPI
    9 === RUN   TestDial
   10 === PAUSE TestDial
   11 === RUN   TestEmbedded
   12 === PAUSE TestEmbedded
   13 === CONT  TestAPI
   14 === CONT  TestEmbedded
   15 === CONT  TestDial
   16 === RUN   TestAPI/BufAttach
   17 --- PASS: TestEmbedded (0.00s)
   18 === RUN   TestAPI/SimpleHandler
   19 --- PASS: TestDial (0.01s)
   20 === RUN   TestAPI/Buffer
   21 === RUN   TestAPI/Buffer/Nvim
   22 === RUN   TestAPI/Buffer/Nvim/Buffers
   23 === RUN   TestAPI/Buffer/Nvim/Var
   24 === RUN   TestAPI/Buffer/Nvim/Delete
   25     nvim_test.go:329: nvim:nvim_buf_delete exception: Invalid method: nvim_buf_delete
   26 === RUN   TestAPI/Buffer/Nvim/ChangeTick
   27     nvim_test.go:361: nvim:nvim_buf_delete exception: Invalid method: nvim_buf_delete
   28 === RUN   TestAPI/Buffer/Batch
   29 === RUN   TestAPI/Buffer/Batch/Buffers
   30     nvim_test.go:376: expected one buf, found 3 bufs
   31 === RUN   TestAPI/Buffer/Batch/Var
   32 === RUN   TestAPI/Buffer/Batch/Delete
   33     nvim_test.go:452: nvim:nvim_buf_delete exception: Invalid method: nvim_buf_delete
   34 === RUN   TestAPI/Buffer/Batch/ChangeTick
   35     nvim_test.go:490: nvim:nvim_buf_delete exception: Invalid method: nvim_buf_delete
   36 === RUN   TestAPI/Window
   37 === RUN   TestAPI/Window/Nvim
   38 === PAUSE TestAPI/Window/Nvim
   39 === RUN   TestAPI/Window/Batch
   40 === PAUSE TestAPI/Window/Batch
   41 === CONT  TestAPI/Window/Nvim
   42 === CONT  TestAPI/Window/Batch
   43 === RUN   TestAPI/Tabpage
   44 === RUN   TestAPI/Tabpage/Nvim
   45 === PAUSE TestAPI/Tabpage/Nvim
   46 === RUN   TestAPI/Tabpage/Batch
   47 === PAUSE TestAPI/Tabpage/Batch
   48 === CONT  TestAPI/Tabpage/Nvim
   49 === CONT  TestAPI/Tabpage/Batch
   50 === RUN   TestAPI/Lines
   51 === RUN   TestAPI/Lines/Nvim
   52 === RUN   TestAPI/Lines/Nvim/BufferLines
   53 === RUN   TestAPI/Lines/Nvim/SetBufferText
   54     nvim_test.go:699: nvim:nvim_buf_set_text exception: Invalid method: nvim_buf_set_text
   55 === RUN   TestAPI/Lines/Batch
   56 === RUN   TestAPI/Lines/Batch/BufferLines
   57 === RUN   TestAPI/Lines/Batch/SetBufferText
   58     nvim_test.go:802: nvim:nvim_buf_set_text exception: Invalid method: nvim_buf_set_text
   59 === RUN   TestAPI/Var
   60 === RUN   TestAPI/Var/Nvim
   61 === RUN   TestAPI/Var/Batch
   62 === RUN   TestAPI/Message
   63 === RUN   TestAPI/Message/Nvim
   64     nvim_test.go:911: failed to SetVVar: nvim:nvim_exec exception: Invalid method: nvim_exec
   65 === RUN   TestAPI/Message/Batch
   66 === RUN   TestAPI/StructValue
   67 === RUN   TestAPI/StructValue/Nvim
   68 === PAUSE TestAPI/StructValue/Nvim
   69 === RUN   TestAPI/StructValue/Batch
   70 === PAUSE TestAPI/StructValue/Batch
   71 === CONT  TestAPI/StructValue/Nvim
   72 === CONT  TestAPI/StructValue/Batch
   73 === RUN   TestAPI/Eval
   74 === RUN   TestAPI/Eval/Nvim
   75 === PAUSE TestAPI/Eval/Nvim
   76 === RUN   TestAPI/Eval/Batch
   77 === PAUSE TestAPI/Eval/Batch
   78 === CONT  TestAPI/Eval/Nvim
   79 === CONT  TestAPI/Eval/Batch
   80 === RUN   TestAPI/Batch
   81 === RUN   TestAPI/CallWithNoArgs
   82 === RUN   TestAPI/Mode
   83 === RUN   TestAPI/ExecLua
   84 === RUN   TestAPI/ExecLua/Nvim
   85 === PAUSE TestAPI/ExecLua/Nvim
   86 === RUN   TestAPI/ExecLua/Batch
   87 === PAUSE TestAPI/ExecLua/Batch
   88 === CONT  TestAPI/ExecLua/Nvim
   89 === CONT  TestAPI/ExecLua/Batch
   90     nvim_test.go:1232: nvim:nvim_exec_lua exception: Invalid method: nvim_exec_lua
   91 === CONT  TestAPI/ExecLua/Nvim
   92     nvim_test.go:1217: nvim:nvim_exec_lua exception: Invalid method: nvim_exec_lua
   93 === RUN   TestAPI/Highlight
   94 === RUN   TestAPI/Highlight/Nvim
   95 === PAUSE TestAPI/Highlight/Nvim
   96 === RUN   TestAPI/Highlight/Batch
   97 === PAUSE TestAPI/Highlight/Batch
   98 === CONT  TestAPI/Highlight/Nvim
   99 === CONT  TestAPI/Highlight/Batch
  100 === CONT  TestAPI/Highlight/Nvim
  101     nvim_test.go:1298: nvim:nvim_set_hl exception: Invalid method: nvim_set_hl
  102 === CONT  TestAPI/Highlight/Batch
  103     nvim_test.go:1405: nvim:nvim_set_hl exception: Invalid method: nvim_set_hl
  104 === RUN   TestAPI/VirtualText
  105 === RUN   TestAPI/FloatingWindow
  106 === RUN   TestAPI/Context
  107 === RUN   TestAPI/Extmarks
  108     nvim_test.go:1600: nvim:nvim_buf_set_extmark exception: Invalid method: nvim_buf_set_extmark
  109 === RUN   TestAPI/RuntimeFiles
  110     nvim_test.go:1644: nvim:nvim_get_runtime_file exception: Invalid method: nvim_get_runtime_file
  111 === RUN   TestAPI/AllOptionsInfo
  112     nvim_test.go:1684: nvim:nvim_get_all_options_info exception: Invalid method: nvim_get_all_options_info
  113 === RUN   TestAPI/OptionsInfo
  114 === RUN   TestAPI/OptionsInfo/Nvim/filetype
  115 === PAUSE TestAPI/OptionsInfo/Nvim/filetype
  116 === RUN   TestAPI/OptionsInfo/Nvim/cmdheight
  117 === PAUSE TestAPI/OptionsInfo/Nvim/cmdheight
  118 === RUN   TestAPI/OptionsInfo/Nvim/hidden
  119 === PAUSE TestAPI/OptionsInfo/Nvim/hidden
  120 === RUN   TestAPI/OptionsInfo/Batch/cmdheight
  121 === PAUSE TestAPI/OptionsInfo/Batch/cmdheight
  122 === RUN   TestAPI/OptionsInfo/Batch/hidden
  123 === PAUSE TestAPI/OptionsInfo/Batch/hidden
  124 === RUN   TestAPI/OptionsInfo/Batch/filetype
  125 === PAUSE TestAPI/OptionsInfo/Batch/filetype
  126 === CONT  TestAPI/OptionsInfo/Nvim/filetype
  127 === CONT  TestAPI/OptionsInfo/Batch/cmdheight
  128 === CONT  TestAPI/OptionsInfo/Nvim/hidden
  129 === CONT  TestAPI/OptionsInfo/Nvim/cmdheight
  130 === CONT  TestAPI/OptionsInfo/Nvim/filetype
  131     nvim_test.go:1768: nvim:nvim_get_option_info exception: Invalid method: nvim_get_option_info
  132 === CONT  TestAPI/OptionsInfo/Nvim/hidden
  133     nvim_test.go:1768: nvim:nvim_get_option_info exception: Invalid method: nvim_get_option_info
  134 === CONT  TestAPI/OptionsInfo/Nvim/cmdheight
  135     nvim_test.go:1768: nvim:nvim_get_option_info exception: Invalid method: nvim_get_option_info
  136 === CONT  TestAPI/OptionsInfo/Batch/cmdheight
  137     nvim_test.go:1786: nvim:nvim_get_option_info exception: Invalid method: nvim_get_option_info
  138 === CONT  TestAPI/OptionsInfo/Batch/hidden
  139 === CONT  TestAPI/OptionsInfo/Batch/filetype
  140     nvim_test.go:1786: nvim:nvim_get_option_info exception: Invalid method: nvim_get_option_info
  141 === CONT  TestAPI/OptionsInfo/Batch/hidden
  142     nvim_test.go:1786: nvim:nvim_get_option_info exception: Invalid method: nvim_get_option_info
  143 --- FAIL: TestAPI (0.02s)
  144     --- PASS: TestAPI/BufAttach (0.01s)
  145     --- PASS: TestAPI/SimpleHandler (0.00s)
  146     --- FAIL: TestAPI/Buffer (0.00s)
  147         --- FAIL: TestAPI/Buffer/Nvim (0.00s)
  148             --- PASS: TestAPI/Buffer/Nvim/Buffers (0.00s)
  149             --- PASS: TestAPI/Buffer/Nvim/Var (0.00s)
  150             --- FAIL: TestAPI/Buffer/Nvim/Delete (0.00s)
  151             --- FAIL: TestAPI/Buffer/Nvim/ChangeTick (0.00s)
  152         --- FAIL: TestAPI/Buffer/Batch (0.00s)
  153             --- FAIL: TestAPI/Buffer/Batch/Buffers (0.00s)
  154             --- PASS: TestAPI/Buffer/Batch/Var (0.00s)
  155             --- FAIL: TestAPI/Buffer/Batch/Delete (0.00s)
  156             --- FAIL: TestAPI/Buffer/Batch/ChangeTick (0.00s)
  157     --- PASS: TestAPI/Window (0.00s)
  158         --- PASS: TestAPI/Window/Nvim (0.00s)
  159         --- PASS: TestAPI/Window/Batch (0.00s)
  160     --- PASS: TestAPI/Tabpage (0.00s)
  161         --- PASS: TestAPI/Tabpage/Batch (0.00s)
  162         --- PASS: TestAPI/Tabpage/Nvim (0.00s)
  163     --- FAIL: TestAPI/Lines (0.00s)
  164         --- FAIL: TestAPI/Lines/Nvim (0.00s)
  165             --- PASS: TestAPI/Lines/Nvim/BufferLines (0.00s)
  166             --- FAIL: TestAPI/Lines/Nvim/SetBufferText (0.00s)
  167         --- FAIL: TestAPI/Lines/Batch (0.00s)
  168             --- PASS: TestAPI/Lines/Batch/BufferLines (0.00s)
  169             --- FAIL: TestAPI/Lines/Batch/SetBufferText (0.00s)
  170     --- PASS: TestAPI/Var (0.00s)
  171         --- PASS: TestAPI/Var/Nvim (0.00s)
  172         --- PASS: TestAPI/Var/Batch (0.00s)
  173     --- FAIL: TestAPI/Message (0.00s)
  174         --- FAIL: TestAPI/Message/Nvim (0.00s)
  175         --- PASS: TestAPI/Message/Batch (0.00s)
  176     --- PASS: TestAPI/StructValue (0.00s)
  177         --- PASS: TestAPI/StructValue/Nvim (0.00s)
  178         --- PASS: TestAPI/StructValue/Batch (0.00s)
  179     --- PASS: TestAPI/Eval (0.00s)
  180         --- PASS: TestAPI/Eval/Batch (0.00s)
  181         --- PASS: TestAPI/Eval/Nvim (0.00s)
  182     --- PASS: TestAPI/Batch (0.00s)
  183     --- PASS: TestAPI/CallWithNoArgs (0.00s)
  184     --- PASS: TestAPI/Mode (0.00s)
  185     --- FAIL: TestAPI/ExecLua (0.00s)
  186         --- FAIL: TestAPI/ExecLua/Batch (0.00s)
  187         --- FAIL: TestAPI/ExecLua/Nvim (0.00s)
  188     --- FAIL: TestAPI/Highlight (0.00s)
  189         --- FAIL: TestAPI/Highlight/Nvim (0.00s)
  190         --- FAIL: TestAPI/Highlight/Batch (0.00s)
  191     --- PASS: TestAPI/VirtualText (0.00s)
  192     --- PASS: TestAPI/FloatingWindow (0.00s)
  193     --- PASS: TestAPI/Context (0.00s)
  194     --- FAIL: TestAPI/Extmarks (0.00s)
  195     --- FAIL: TestAPI/RuntimeFiles (0.00s)
  196     --- FAIL: TestAPI/AllOptionsInfo (0.00s)
  197     --- FAIL: TestAPI/OptionsInfo (0.00s)
  198         --- FAIL: TestAPI/OptionsInfo/Nvim/filetype (0.00s)
  199         --- FAIL: TestAPI/OptionsInfo/Nvim/hidden (0.00s)
  200         --- FAIL: TestAPI/OptionsInfo/Nvim/cmdheight (0.00s)
  201         --- FAIL: TestAPI/OptionsInfo/Batch/cmdheight (0.00s)
  202         --- FAIL: TestAPI/OptionsInfo/Batch/filetype (0.00s)
  203         --- FAIL: TestAPI/OptionsInfo/Batch/hidden (0.00s)
  204 FAIL
  205 exit status 1
  206 FAIL  github.com/neovim/go-client/nvim  0.028s
zchee commented 3 years ago

@slzatz Ah, neovim/go-client follows neovim latest (HEAD) APIs.So it's normal. I use NVIM v0.5.0 and test this repository uses https://github.com/neovim/neovim/releases/tag/nightly (which update per day). If you want to use go-client, please always use the neovim nightly version.

Thankns.