rcasia / neotest-java

Neotest adapter for Java.
MIT License
42 stars 22 forks source link

Unable to run tests #163

Open PiotrRaszkowski opened 8 hours ago

PiotrRaszkowski commented 8 hours ago

When I am trying to run:

E5108: Error executing lua .../piotr/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:100: Async task failed without callback: The coroutine failed with this message:                                                                                                                                                
...al/share/nvim/lazy/neotest/lua/neotest/consumers/run.lua:38: attempt to index upvalue 'client' (a nil value)                                                                                                                                                                                                                
stack traceback:                                                                                                                                                                                                                                                                                                               
        ...al/share/nvim/lazy/neotest/lua/neotest/consumers/run.lua: in function <...al/share/nvim/lazy/neotest/lua/neotest/consumers/run.lua:25>                                                                                                                                                                              
        ...al/share/nvim/lazy/neotest/lua/neotest/consumers/run.lua:39: in function 'get_tree_from_args'                                                                                                                                                                                                                       
        ...al/share/nvim/lazy/neotest/lua/neotest/consumers/run.lua:80: in function 'func'                                                                                                                                                                                                                                     
        .../piotr/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:173: in function <.../piotr/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:172>                                                                                                                                                                         
stack traceback:                                                                                                                                                                                                                                                                                                               
        [C]: in function 'error'                                                                                                                                                                                                                                                                                               
        .../piotr/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:100: in function 'close_task'                                                                                                                                                                                                                              
        .../piotr/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:122: in function 'step'                                                                                                                                                                                                                                    
        .../piotr/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:150: in function 'run'                                                                                                                                                                                                                                     
        [string ":lua"]:1: in main chunk                                                                             

I have no idea what Is going on.

This is my lua config:

return {
    {
        "rcasia/neotest-java",
        ft = "java",
        dependencies = {
            "mfussenegger/nvim-jdtls",
            "mfussenegger/nvim-dap", -- for the debugger
            "rcarriga/nvim-dap-ui", -- recommended
            "theHamsta/nvim-dap-virtual-text", -- recommended
        },
    },
    {
        "nvim-neotest/neotest",
        dependencies = {
            "nvim-neotest/nvim-nio",
            "nvim-lua/plenary.nvim",
            "antoinemadec/FixCursorHold.nvim",
            "nvim-treesitter/nvim-treesitter",
        },
        opts = {
            adapters = {
                ["neotest-java"] = {
                    -- config here
                },
            },
        },
    },
}

I am executing:

:lua require("neotest").run.run(vim.fn.expand("%"))
rcasia commented 8 hours ago

Can you share your neovim version?

Also have you tried to reinstall the treesitter parser? (:TSInstall java)

PiotrRaszkowski commented 8 hours ago

TSInstall done, installed (even re-installed, no success). Neovim version: NVIM v0.10.2 Build type: Release LuaJIT 2.1.1727870382

System: MacOS

rcasia commented 7 hours ago

Try this steps to share the logs:

  1. Wipe the neotest.log and neotest-java.log file in stdpath("log") or stdpath("data").
  2. Set log_level = vim.log.levels.DEBUG in your neotest setup config.
  3. Reproduce the issue.
  4. Provide the new logs.