nvim-neotest / neotest-go

MIT License
124 stars 43 forks source link

Error while testing a file/directory with failed test cases #50

Open ansidev opened 1 year ago

ansidev commented 1 year ago

Reproduce

  1. Run
    :lua require('neotest').run.run("path/to/file/or/directory") -- please replace value 

Unfortunately, I cannot provide the code, however, I guess you can use your own one.

  1. A bottom panel will be displayed with error lines. Select a random item immediately and press Enter

  2. The error will be displayed.

Error output

Error executing vim.schedule lua callback: ...local/share/nvim_ansidev/lazy/neotest/lua/nio/tasks.lua:95: Async task failed without callback: The coroutine failed with this message:
...nsidev/lazy/neotest/lua/neotest/consumers/diagnostic.lua:95: attempt to perform arithmetic on a nil value
stack traceback:
        ...nsidev/lazy/neotest/lua/neotest/consumers/diagnostic.lua: in function 'create_diagnostics'
        ...nsidev/lazy/neotest/lua/neotest/consumers/diagnostic.lua:54: in function 'draw_buffer'
        ...nsidev/lazy/neotest/lua/neotest/consumers/diagnostic.lua:163: in function 'draw_buffer'
        ...nsidev/lazy/neotest/lua/neotest/consumers/diagnostic.lua:173: in function 'listener'
        ..._ansidev/lazy/neotest/lua/neotest/client/events/init.lua:51: in function <..._ansidev/lazy/neotest/lua/neotest/client/events/init.lua:47>
stack traceback:
        [C]: in function 'error'
        ....local/share/nvim_ansidev/lazy/neotest/lua/nio/tasks.lua:95: in function 'close_task'
        ....local/share/nvim_ansidev/lazy/neotest/lua/nio/tasks.lua:117: in function 'cb'
        ....local/share/nvim_ansidev/lazy/neotest/lua/nio/tasks.lua:179: in function <....local/share/nvim_ansidev/lazy/neotest/lua/nio/tasks.lua:178>
fredrikaverpil commented 2 months ago

I believe I found the (upstream) issue: https://github.com/nvim-neotest/neotest/pull/396