nvim-neotest / neotest

An extensible framework for interacting with tests within NeoVim.
MIT License
2.35k stars 115 forks source link

[BUG] Coroutine failed when run null-ls code formatter after running Neotest #152

Closed ziontee113 closed 1 year ago

ziontee113 commented 1 year ago

NeoVim Version 0.8.0

Describe the bug After running neotest in Rust files, using vim.lsp.format() will result in error:

[null-ls] error in formatting handler: /usr/share/nvim/runtime/lua/vim/lsp/util.lua:396: Vim(append):Error executing lua callback: ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: ...te/pack/packer/start/neotest/lua/neotest/client/init.lua:362: neotest-plenary:/home/ziontee113
stack traceback:
    [C]: in function 'error'
    ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
    ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:45: in function 'step'
    ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:48: in function 'execute'
    ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:108: in function 'run'
    ...te/pack/packer/start/neotest/lua/neotest/client/init.lua:358: in function <...te/pack/packer/start/neotest/lua/neotest/client/init.lua:356>
    [C]: in function 'resume'
    ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:45: in function <...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:44>
    [C]: in function 'wait'
    /usr/share/nvim/runtime/lua/vim/lsp.lua:1434: in function 'request_sync'
    /usr/share/nvim/runtime/lua/vim/lsp/buf.lua:276: in function 'format'
    /home/ziontee113/.config/nvim/lua/lsp-config/init.lua:7: in function 'lsp_formatting'
    /home/ziontee113/.config/nvim/lua/lsp-config/init.lua:75: in function </home/ziontee113/.config/nvim/lua/lsp-config/init.lua:74>

Temporary Solution Lock neotest commit to 2e975ae64b0c476b72274a1d6166a22f0f01b2d5 using packer.

rcarriga commented 1 year ago

Can you please provide bug report template info? I can not reproduce

ziontee113 commented 1 year ago

Sorry, the bug report template was overwhelming at first.

NeoVim Version

Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Describe the bug After running nvim --clean -u minimal.lua using the config in the bug report template, I go to this example Rust file:

#[allow(dead_code)]
fn add(a: i32, b: i32) -> i32 {
    a + b
}

#[allow(dead_code)]
fn bad_add(a: i32, b: i32) -> i32 {
    a - b
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_add() {
        assert_eq!(add(1, 2), 3);
    }

    #[test]
    fn test_bad_add() {
        assert_eq!(bad_add(1, 2), 3);
    }
}

Run :lua require("neotest").run().run() and get the error:

E5108: Error executing lua ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:18: The coroutine failed with this message: .../pack/packer/start/neotest/lua/neotest/consumers/run.lua:31: attempt to index u
pvalue 'client' (a nil value)
stack traceback:
        [C]: in function 'error'
        ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:18: in function 'callback_or_next'
        ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:45: in function 'step'
        ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:48: in function 'execute'
        ...ck/packer/start/plenary.nvim/lua/plenary/async/async.lua:108: in function 'run'
        .../pack/packer/start/neotest/lua/neotest/consumers/run.lua:72: in function 'run'
        [string ":lua"]:1: in main chunk

After that I add neotest-rust to the minimal.lua file, go back to the Rust test file, run :lua require("neotest").run().run(), it says "No Test Found". When I try :NeotestFile and :NeotestSummary, the tests just and doesn't work.

Logs

WARN | 2022-11-14T00:15:18Z+0700 | ...packer/start/neotest/lua/neotest/lib/treesitter/init.lua:182 | Using `build_position` or `position_id` functions with subprocess parsing is not supported, switch to using strings for remote calls
WARN | 2022-11-14T00:15:18Z+0700 | ...packer/start/neotest/lua/neotest/lib/treesitter/init.lua:182 | Using `build_position` or `position_id` functions with subprocess parsing is not supported, switch to using strings for remote calls
ERROR | 2022-11-14T00:15:18Z+0700 | ...ig/pack/packer/start/neotest/lua/neotest/client/init.lua:274 | Couldn't find positions in path /home/ziontee113/learn-rust/learn-unit-test/src/main.rs /usr/share/nvim/runtime/lua/vim/treesitter/language.lua:26: no parser for 'rust' language, see :help treesitter-parsers
ERROR | 2022-11-14T00:15:18Z+0700 | ...ig/pack/packer/start/neotest/lua/neotest/client/init.lua:274 | Couldn't find positions in path /home/ziontee113/learn-rust/learn-unit-test/src/module.rs /usr/share/nvim/runtime/lua/vim/treesitter/language.lua:26: no parser for 'rust' language, see :help treesitter-parsers
WARN | 2022-11-14T00:16:27Z+0700 | ...packer/start/neotest/lua/neotest/lib/treesitter/init.lua:182 | Using `build_position` or `position_id` functions with subprocess parsing is not supported, switch to using strings for remote calls
WARN | 2022-11-14T00:16:27Z+0700 | ...packer/start/neotest/lua/neotest/lib/treesitter/init.lua:182 | Using `build_position` or `position_id` functions with subprocess parsing is not supported, switch to using strings for remote calls
ERROR | 2022-11-14T00:16:27Z+0700 | ...ig/pack/packer/start/neotest/lua/neotest/client/init.lua:274 | Couldn't find positions in path /home/ziontee113/learn-rust/learn-unit-test/src/main.rs /usr/share/nvim/runtime/lua/vim/treesitter/language.lua:26: no parser for 'rust' language, see :help treesitter-parsers
ERROR | 2022-11-14T00:16:27Z+0700 | ...ig/pack/packer/start/neotest/lua/neotest/client/init.lua:274 | Couldn't find positions in path /home/ziontee113/learn-rust/learn-unit-test/src/module.rs /usr/share/nvim/runtime/lua/vim/treesitter/language.lua:26: no parser for 'rust' language, see :help treesitter-parsers
WARN | 2022-11-14T00:19:25Z+0700 | ...packer/start/neotest/lua/neotest/lib/treesitter/init.lua:182 | Using `build_position` or `position_id` functions with subprocess parsing is not supported, switch to using strings for remote calls
WARN | 2022-11-14T00:19:25Z+0700 | ...packer/start/neotest/lua/neotest/lib/treesitter/init.lua:182 | Using `build_position` or `position_id` functions with subprocess parsing is not supported, switch to using strings for remote calls
ERROR | 2022-11-14T00:19:25Z+0700 | ...ig/pack/packer/start/neotest/lua/neotest/client/init.lua:274 | Couldn't find positions in path /home/ziontee113/learn-rust/learn-unit-test/src/main.rs /usr/share/nvim/runtime/lua/vim/treesitter/language.lua:26: no parser for 'rust' language, see :help treesitter-parsers
ERROR | 2022-11-14T00:19:25Z+0700 | ...ig/pack/packer/start/neotest/lua/neotest/client/init.lua:274 | Couldn't find positions in path /home/ziontee113/learn-rust/learn-unit-test/src/module.rs /usr/share/nvim/runtime/lua/vim/treesitter/language.lua:26: no parser for 'rust' language, see :help treesitter-parsers

Additional context I'm really confused and don't know what to do right now. It seems the minimal.lua file lacks the directions to install Treesitter Parsers.

rcarriga commented 1 year ago

You can just run :TSInstall rust using the minimal init and it should then work as expected

ziontee113 commented 1 year ago

You can just run :TSInstall rust using the minimal init and it should then work as expected.

Yes indeed it works with the minimal config.

However, I run into issues while using null-ls:

https://user-images.githubusercontent.com/102876811/201535751-aa6fec49-73bc-45b9-835c-87587509d4a1.mp4

https://user-images.githubusercontent.com/102876811/201535756-6ae9be62-2e6e-4be1-a238-e0bd4a4205b8.mp4

I set my nvim so it automatically format my file on save with null-ls. It works just fine with the old commit from more than a week ago :thinking: With the latest version of Neotest, if I save a file after running tests, neovim just becomes unusable.

ziontee113 commented 1 year ago

Maybe this is not a Neotest bug but a plenary bug? :thinking:

rcarriga commented 1 year ago

No it's a neotest issue, the plenary stacktrace is because the async library it provides doesn't really provide good stacktraces unfortunately.

However, I run into issues while using null-ls:

If you can add null-ls to the minimal config and reproduce, then I'll be able to use that to figure out the issue.

Also with your own config, can you set log_level = vim.log.levels.DEBUG, in the neotest config and provide the log? The log directory can be found by running :echo stdpath("log"). Please delete the existing log, set it to debug level, reproduce and then paste it here. It will have information about the files you're using so make sure there's nothing sensitive in them :smile:

ziontee113 commented 1 year ago

I tried installing null-ls in the minimal.lua. It works find and raises no error :thinking: Although we haven't thrown nvim-lspconfig into the mix yet :thinking:

Here's the log of my actual config, after running a test, format the file and errors like video above:

``` INFO | 2022-11-14T01:35:50Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/config/init.lua:274 | Configuration complete DEBUG | 2022-11-14T01:35:50Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/config/init.lua:275 | User config { adapters = { { build_spec = , discover_positions = , is_test_file = , name = "neotest-plenary", results = , root = , = { __call = } }, { build_spec = , discover_positions = , is_test_file = , name = "neotest-rust", results = , root = , = { __call = } } }, benchmark = { enabled = true }, consumers = {}, default_strategy = "integrated", diagnostic = { enabled = true }, discovery = { concurrent = 8, enabled = true }, floating = { border = "rounded", max_height = 0.6, max_width = 0.6, options = {} }, highlights = { adapter_name = "NeotestAdapterName", border = "NeotestBorder", dir = "NeotestDir", expand_marker = "NeotestExpandMarker", failed = "NeotestFailed", file = "NeotestFile", focused = "NeotestFocused", indent = "NeotestIndent", marked = "NeotestMarked", namespace = "NeotestNamespace", passed = "NeotestPassed", running = "NeotestRunning", select_win = "NeotestWinSelect", skipped = "NeotestSkipped", target = "NeotestTarget", test = "NeotestTest", unknown = "NeotestUnknown" }, icons = { child_indent = "│", child_prefix = "├", collapsed = "─", expanded = "╮", failed = "", final_child_indent = " ", final_child_prefix = "╰", non_collapsible = "─", passed = "", running = "", running_animated = { "/", "|", "\\", "-", "/", "|", "\\", "-" }, skipped = "", unknown = "" }, jump = { enabled = true }, log_level = 1, output = { enabled = true, open_on_run = "short" }, projects = { = { __index = } }, run = { enabled = true }, running = { concurrent = true }, status = { enabled = true, signs = true, virtual_text = false }, strategies = { integrated = { height = 40, width = 120 } }, summary = { animated = true, enabled = true, expand_errors = true, follow = true, mappings = { attach = "a", clear_marked = "M", clear_target = "T", debug = "d", debug_marked = "D", expand = { "", "<2-LeftMouse>" }, expand_all = "e", jumpto = "i", mark = "m", next_failed = "J", output = "o", prev_failed = "K", run = "r", run_marked = "R", short = "O", stop = "u", target = "t" } } } INFO | 2022-11-14T01:35:58Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/config/init.lua:274 | Configuration complete DEBUG | 2022-11-14T01:35:58Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/config/init.lua:275 | User config { adapters = { { build_spec = , discover_positions = , is_test_file = , name = "neotest-plenary", results = , root = , = { __call = } }, { build_spec = , discover_positions = , is_test_file = , name = "neotest-rust", results = , root = , = { __call = } } }, benchmark = { enabled = true }, consumers = {}, default_strategy = "integrated", diagnostic = { enabled = true }, discovery = { concurrent = 8, enabled = true }, floating = { border = "rounded", max_height = 0.6, max_width = 0.6, options = {} }, highlights = { adapter_name = "NeotestAdapterName", border = "NeotestBorder", dir = "NeotestDir", expand_marker = "NeotestExpandMarker", failed = "NeotestFailed", file = "NeotestFile", focused = "NeotestFocused", indent = "NeotestIndent", marked = "NeotestMarked", namespace = "NeotestNamespace", passed = "NeotestPassed", running = "NeotestRunning", select_win = "NeotestWinSelect", skipped = "NeotestSkipped", target = "NeotestTarget", test = "NeotestTest", unknown = "NeotestUnknown" }, icons = { child_indent = "│", child_prefix = "├", collapsed = "─", expanded = "╮", failed = "", final_child_indent = " ", final_child_prefix = "╰", non_collapsible = "─", passed = "", running = "", running_animated = { "/", "|", "\\", "-", "/", "|", "\\", "-" }, skipped = "", unknown = "" }, jump = { enabled = true }, log_level = 1, output = { enabled = true, open_on_run = "short" }, projects = { = { __index = } }, run = { enabled = true }, running = { concurrent = true }, status = { enabled = true, signs = true, virtual_text = false }, strategies = { integrated = { height = 40, width = 120 } }, summary = { animated = true, enabled = true, expand_errors = true, follow = true, mappings = { attach = "a", clear_marked = "M", clear_target = "T", debug = "d", debug_marked = "D", expand = { "", "<2-LeftMouse>" }, expand_all = "e", jumpto = "i", mark = "m", next_failed = "J", output = "o", prev_failed = "K", run = "r", run_marked = "R", short = "O", stop = "u", target = "t" } } } INFO | 2022-11-14T01:36:08Z+0700 | ...pack/packer/start/neotest/lua/neotest/lib/subprocess.lua:25 | Starting child process INFO | 2022-11-14T01:36:08Z+0700 | ...pack/packer/start/neotest/lua/neotest/lib/subprocess.lua:29 | Starting child process with command: /usr/bin/nvim --embed --headless INFO | 2022-11-14T01:36:08Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/config/init.lua:274 | Configuration complete DEBUG | 2022-11-14T01:36:08Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/config/init.lua:275 | User config { adapters = { { build_spec = , discover_positions = , is_test_file = , name = "neotest-plenary", results = , root = , = { __call = } }, { build_spec = , discover_positions = , is_test_file = , name = "neotest-rust", results = , root = , = { __call = } } }, benchmark = { enabled = true }, consumers = {}, default_strategy = "integrated", diagnostic = { enabled = true }, discovery = { concurrent = 8, enabled = true }, floating = { border = "rounded", max_height = 0.6, max_width = 0.6, options = {} }, highlights = { adapter_name = "NeotestAdapterName", border = "NeotestBorder", dir = "NeotestDir", expand_marker = "NeotestExpandMarker", failed = "NeotestFailed", file = "NeotestFile", focused = "NeotestFocused", indent = "NeotestIndent", marked = "NeotestMarked", namespace = "NeotestNamespace", passed = "NeotestPassed", running = "NeotestRunning", select_win = "NeotestWinSelect", skipped = "NeotestSkipped", target = "NeotestTarget", test = "NeotestTest", unknown = "NeotestUnknown" }, icons = { child_indent = "│", child_prefix = "├", collapsed = "─", expanded = "╮", failed = "", final_child_indent = " ", final_child_prefix = "╰", non_collapsible = "─", passed = "", running = "", running_animated = { "/", "|", "\\", "-", "/", "|", "\\", "-" }, skipped = "", unknown = "" }, jump = { enabled = true }, log_level = 1, output = { enabled = true, open_on_run = "short" }, projects = { = { __index = } }, run = { enabled = true }, running = { concurrent = true }, status = { enabled = true, signs = true, virtual_text = false }, strategies = { integrated = { height = 40, width = 120 } }, summary = { animated = true, enabled = true, expand_errors = true, follow = true, mappings = { attach = "a", clear_marked = "M", clear_target = "T", debug = "d", debug_marked = "D", expand = { "", "<2-LeftMouse>" }, expand_all = "e", jumpto = "i", mark = "m", next_failed = "J", output = "o", prev_failed = "K", run = "r", run_marked = "R", short = "O", stop = "u", target = "t" } } } INFO | 2022-11-14T01:36:08Z+0700 | ...pack/packer/start/neotest/lua/neotest/lib/subprocess.lua:66 | CHILD | Connected to parent instance INFO | 2022-11-14T01:36:08Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/client/init.lua:342 | Initialising client INFO | 2022-11-14T01:36:08Z+0700 | .../pack/packer/start/neotest/lua/neotest/adapters/init.lua:18 | Found 2 adapters for directory /home/ziontee113/learn-rust/learn-unit-test DEBUG | 2022-11-14T01:36:08Z+0700 | .../pack/packer/start/neotest/lua/neotest/adapters/init.lua:19 | Adapters: { { adapter = { build_spec = , discover_positions = , is_test_file = , name = "neotest-plenary", results = , root = , = { __call = } }, root = "/home/ziontee113" }, { adapter = { build_spec = , discover_positions = , is_test_file = , name = "neotest-rust", results = , root = , = { __call = } }, root = "/home/ziontee113/learn-rust/learn-unit-test" } } INFO | 2022-11-14T01:36:08Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/client/init.lua:243 | Searching /home/ziontee113 for test files ERROR | 2022-11-14T01:36:09Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/client/init.lua:274 | Couldn't find positions in path /home/ziontee113 .../pack/packer/start/neotest/lua/neotest/lib/file/find.lua:30: EACCES: permission denied: /home/ziontee113/pacman/var/cache/ldconfig INFO | 2022-11-14T01:36:09Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/client/init.lua:243 | Searching /home/ziontee113/learn-rust/learn-unit-test for test files DEBUG | 2022-11-14T01:36:09Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/client/init.lua:259 | Found { { id = "/home/ziontee113/learn-rust/learn-unit-test", name = "learn-unit-test", path = "/home/ziontee113/learn-rust/learn-unit-test", type = "dir" }, { { id = "/home/ziontee113/learn-rust/learn-unit-test/src", name = "src", path = "/home/ziontee113/learn-rust/learn-unit-test/src", type = "dir" }, { { id = "/home/ziontee113/learn-rust/learn-unit-test/src/main.rs", name = "main.rs", path = "/home/ziontee113/learn-rust/learn-unit-test/src/main.rs", type = "file" } }, { { id = "/home/ziontee113/learn-rust/learn-unit-test/src/module.rs", name = "module.rs", path = "/home/ziontee113/learn-rust/learn-unit-test/src/module.rs", type = "file" } } } } DEBUG | 2022-11-14T01:36:09Z+0700 | ...k/packer/start/neotest/lua/neotest/client/state/init.lua:54 | New positions at ID /home/ziontee113/learn-rust/learn-unit-test INFO | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:46 | Emitting discover_positions event DEBUG | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener diagnostic for event discover_positions INFO | 2022-11-14T01:36:09Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/client/init.lua:289 | Discovering files with 8 workers INFO | 2022-11-14T01:36:09Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/client/init.lua:263 | Parsing /home/ziontee113/learn-rust/learn-unit-test/src/main.rs WARN | 2022-11-14T01:36:09Z+0700 | ...packer/start/neotest/lua/neotest/lib/treesitter/init.lua:182 | Using `build_position` or `position_id` functions with subprocess parsing is not supported, switch to using strings for remote calls DEBUG | 2022-11-14T01:36:09Z+0700 | .../pack/packer/start/neotest/lua/neotest/lib/file/init.lua:14 | Reading file: /home/ziontee113/learn-rust/learn-unit-test/src/main.rs INFO | 2022-11-14T01:36:09Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/client/init.lua:263 | Parsing /home/ziontee113/learn-rust/learn-unit-test/src/module.rs WARN | 2022-11-14T01:36:09Z+0700 | ...packer/start/neotest/lua/neotest/lib/treesitter/init.lua:182 | Using `build_position` or `position_id` functions with subprocess parsing is not supported, switch to using strings for remote calls DEBUG | 2022-11-14T01:36:09Z+0700 | .../pack/packer/start/neotest/lua/neotest/lib/file/init.lua:14 | Reading file: /home/ziontee113/learn-rust/learn-unit-test/src/module.rs DEBUG | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener status for event discover_positions DEBUG | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener summary for event discover_positions DEBUG | 2022-11-14T01:36:09Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/client/init.lua:269 | Found { { id = "/home/ziontee113/learn-rust/learn-unit-test/src/main.rs", name = "main.rs", path = "/home/ziontee113/learn-rust/learn-unit-test/src/main.rs", range = { 0, 0, 5, 0 }, type = "file" } } DEBUG | 2022-11-14T01:36:09Z+0700 | ...k/packer/start/neotest/lua/neotest/client/state/init.lua:54 | New positions at ID /home/ziontee113/learn-rust/learn-unit-test/src/main.rs INFO | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:46 | Emitting discover_positions event DEBUG | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener diagnostic for event discover_positions DEBUG | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener status for event discover_positions DEBUG | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener summary for event discover_positions DEBUG | 2022-11-14T01:36:09Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/client/init.lua:269 | Found { { id = "/home/ziontee113/learn-rust/learn-unit-test/src/module.rs", name = "module.rs", path = "/home/ziontee113/learn-rust/learn-unit-test/src/module.rs", range = { 0, 0, 26, 0 }, type = "file" }, { { id = "module::tests", name = "tests", path = "/home/ziontee113/learn-rust/learn-unit-test/src/module.rs", range = { 11, 0, 25, 1 }, type = "namespace" }, { { id = "module::tests::test_add", name = "test_add", path = "/home/ziontee113/learn-rust/learn-unit-test/src/module.rs", range = { 15, 4, 17, 5 }, type = "test" } }, { { id = "module::tests::test_bad_add", name = "test_bad_add", path = "/home/ziontee113/learn-rust/learn-unit-test/src/module.rs", range = { 20, 4, 24, 5 }, type = "test" } } } } DEBUG | 2022-11-14T01:36:09Z+0700 | ...k/packer/start/neotest/lua/neotest/client/state/init.lua:54 | New positions at ID /home/ziontee113/learn-rust/learn-unit-test/src/module.rs INFO | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:46 | Emitting discover_positions event DEBUG | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener diagnostic for event discover_positions DEBUG | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener status for event discover_positions DEBUG | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener summary for event discover_positions INFO | 2022-11-14T01:36:09Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/client/init.lua:439 | Initialisation finished in 0.535 seconds INFO | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:46 | Emitting test_file_focused event DEBUG | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener diagnostic for event test_file_focused DEBUG | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener status for event test_file_focused DEBUG | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener summary for event test_file_focused DEBUG | 2022-11-14T01:36:09Z+0700 | ...k/packer/start/neotest/lua/neotest/client/state/init.lua:85 | Setting positions to running /home/ziontee113/learn-rust/learn-unit-test/src/module.rs INFO | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:46 | Emitting run event DEBUG | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener diagnostic for event run DEBUG | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener status for event run DEBUG | 2022-11-14T01:36:09Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener summary for event run INFO | 2022-11-14T01:36:09Z+0700 | ...ker/start/neotest/lua/neotest/client/strategies/init.lua:31 | Starting process neotest-rust:/home/ziontee113/learn-rust/learn-unit-test-/home/ziontee113/learn-rust/learn-unit-test/src/module.rs with strategy integrated DEBUG | 2022-11-14T01:36:09Z+0700 | ...ker/start/neotest/lua/neotest/client/strategies/init.lua:32 | Strategy spec { command = "cargo nextest run --no-fail-fast --config-file /tmp/nvim.ziontee113/KNI2HQ/0.nextest.toml --profile neotest --no-capture -E 'test(/^module::/)'", context = { file = "/home/ziontee113/learn-rust/learn-unit-test/src/module.rs", junit_path = "/tmp/nvim.ziontee113/KNI2HQ/1.junit.xml", test_filter = "-E 'test(/^module::/)'" }, cwd = "/home/ziontee113/learn-rust/learn-unit-test", strategy = { height = 40, width = 120 } } INFO | 2022-11-14T01:36:10Z+0700 | ...ker/start/neotest/lua/neotest/client/strategies/init.lua:48 | Process for position neotest-rust:/home/ziontee113/learn-rust/learn-unit-test-/home/ziontee113/learn-rust/learn-unit-test/src/module.rs exited with code 100 DEBUG | 2022-11-14T01:36:10Z+0700 | ...ker/start/neotest/lua/neotest/client/strategies/init.lua:50 | Output of process /tmp/nvim.ziontee113/KNI2HQ/2 DEBUG | 2022-11-14T01:36:10Z+0700 | ...k/packer/start/neotest/lua/neotest/client/state/init.lua:70 | New results for adapter neotest-rust:/home/ziontee113/learn-rust/learn-unit-test INFO | 2022-11-14T01:36:10Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:46 | Emitting results event DEBUG | 2022-11-14T01:36:10Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener diagnostic for event results DEBUG | 2022-11-14T01:36:10Z+0700 | ...k/packer/start/neotest/lua/neotest/client/state/init.lua:70 | New results for adapter neotest-rust:/home/ziontee113/learn-rust/learn-unit-test INFO | 2022-11-14T01:36:10Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:46 | Emitting results event DEBUG | 2022-11-14T01:36:10Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener diagnostic for event results DEBUG | 2022-11-14T01:36:10Z+0700 | ...acker/start/neotest/lua/neotest/consumers/diagnostic.lua:54 | Setting diagnostics for /home/ziontee113/learn-rust/learn-unit-test/src/module.rs {} DEBUG | 2022-11-14T01:36:10Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener status for event results DEBUG | 2022-11-14T01:36:10Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener output for event results DEBUG | 2022-11-14T01:36:10Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener summary for event results DEBUG | 2022-11-14T01:36:10Z+0700 | ...acker/start/neotest/lua/neotest/consumers/diagnostic.lua:54 | Setting diagnostics for /home/ziontee113/learn-rust/learn-unit-test/src/module.rs {} DEBUG | 2022-11-14T01:36:10Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener status for event results DEBUG | 2022-11-14T01:36:10Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener output for event results DEBUG | 2022-11-14T01:36:10Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener summary for event results INFO | 2022-11-14T01:36:11Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:46 | Emitting test_file_focused event DEBUG | 2022-11-14T01:36:11Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener diagnostic for event test_file_focused DEBUG | 2022-11-14T01:36:11Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener status for event test_file_focused DEBUG | 2022-11-14T01:36:11Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener summary for event test_file_focused INFO | 2022-11-14T01:36:11Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:46 | Emitting test_focused event DEBUG | 2022-11-14T01:36:11Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener summary for event test_focused INFO | 2022-11-14T01:36:13Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/client/init.lua:263 | Parsing /home/ziontee113/learn-rust/learn-unit-test/src/main.rs WARN | 2022-11-14T01:36:13Z+0700 | ...packer/start/neotest/lua/neotest/lib/treesitter/init.lua:182 | Using `build_position` or `position_id` functions with subprocess parsing is not supported, switch to using strings for remote calls DEBUG | 2022-11-14T01:36:13Z+0700 | .../pack/packer/start/neotest/lua/neotest/lib/file/init.lua:14 | Reading file: /home/ziontee113/learn-rust/learn-unit-test/src/main.rs DEBUG | 2022-11-14T01:36:13Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/client/init.lua:269 | Found { { id = "/home/ziontee113/learn-rust/learn-unit-test/src/main.rs", name = "main.rs", path = "/home/ziontee113/learn-rust/learn-unit-test/src/main.rs", range = { 0, 0, 9, 0 }, type = "file" } } DEBUG | 2022-11-14T01:36:13Z+0700 | ...k/packer/start/neotest/lua/neotest/client/state/init.lua:54 | New positions at ID /home/ziontee113/learn-rust/learn-unit-test/src/main.rs INFO | 2022-11-14T01:36:13Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:46 | Emitting discover_positions event DEBUG | 2022-11-14T01:36:13Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener diagnostic for event discover_positions DEBUG | 2022-11-14T01:36:13Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener status for event discover_positions DEBUG | 2022-11-14T01:36:13Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener summary for event discover_positions INFO | 2022-11-14T01:36:15Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/config/init.lua:274 | Configuration complete DEBUG | 2022-11-14T01:36:15Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/config/init.lua:275 | User config { adapters = { { build_spec = , discover_positions = , is_test_file = , name = "neotest-plenary", results = , root = , = { __call = } }, { build_spec = , discover_positions = , is_test_file = , name = "neotest-rust", results = , root = , = { __call = } } }, benchmark = { enabled = true }, consumers = {}, default_strategy = "integrated", diagnostic = { enabled = true }, discovery = { concurrent = 8, enabled = true }, floating = { border = "rounded", max_height = 0.6, max_width = 0.6, options = {} }, highlights = { adapter_name = "NeotestAdapterName", border = "NeotestBorder", dir = "NeotestDir", expand_marker = "NeotestExpandMarker", failed = "NeotestFailed", file = "NeotestFile", focused = "NeotestFocused", indent = "NeotestIndent", marked = "NeotestMarked", namespace = "NeotestNamespace", passed = "NeotestPassed", running = "NeotestRunning", select_win = "NeotestWinSelect", skipped = "NeotestSkipped", target = "NeotestTarget", test = "NeotestTest", unknown = "NeotestUnknown" }, icons = { child_indent = "│", child_prefix = "├", collapsed = "─", expanded = "╮", failed = "", final_child_indent = " ", final_child_prefix = "╰", non_collapsible = "─", passed = "", running = "", running_animated = { "/", "|", "\\", "-", "/", "|", "\\", "-" }, skipped = "", unknown = "" }, jump = { enabled = true }, log_level = 1, output = { enabled = true, open_on_run = "short" }, projects = { = { __index = } }, run = { enabled = true }, running = { concurrent = true }, status = { enabled = true, signs = true, virtual_text = false }, strategies = { integrated = { height = 40, width = 120 } }, summary = { animated = true, enabled = true, expand_errors = true, follow = true, mappings = { attach = "a", clear_marked = "M", clear_target = "T", debug = "d", debug_marked = "D", expand = { "", "<2-LeftMouse>" }, expand_all = "e", jumpto = "i", mark = "m", next_failed = "J", output = "o", prev_failed = "K", run = "r", run_marked = "R", short = "O", stop = "u", target = "t" } } } INFO | 2022-11-14T01:36:18Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:46 | Emitting test_focused event DEBUG | 2022-11-14T01:36:18Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener summary for event test_focused ```

Here's the one with minimal.lua

```INFO | 2022-11-14T01:41:17Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/config/init.lua:274 | Configuration complete DEBUG | 2022-11-14T01:41:17Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/config/init.lua:275 | User config { adapters = { { build_spec = , discover_positions = , is_test_file = , name = "neotest-plenary", results = , root = , = { __call = } }, { build_spec = , discover_positions = , is_test_file = , name = "neotest-rust", results = , root = , = { __call = } } }, benchmark = { enabled = true }, consumers = {}, default_strategy = "integrated", diagnostic = { enabled = true }, discovery = { concurrent = 8, enabled = true }, floating = { border = "rounded", max_height = 0.6, max_width = 0.6, options = {} }, highlights = { adapter_name = "NeotestAdapterName", border = "NeotestBorder", dir = "NeotestDir", expand_marker = "NeotestExpandMarker", failed = "NeotestFailed", file = "NeotestFile", focused = "NeotestFocused", indent = "NeotestIndent", marked = "NeotestMarked", namespace = "NeotestNamespace", passed = "NeotestPassed", running = "NeotestRunning", select_win = "NeotestWinSelect", skipped = "NeotestSkipped", target = "NeotestTarget", test = "NeotestTest", unknown = "NeotestUnknown" }, icons = { child_indent = "│", child_prefix = "├", collapsed = "─", expanded = "╮", failed = "", final_child_indent = " ", final_child_prefix = "╰", non_collapsible = "─", passed = "", running = "", running_animated = { "/", "|", "\\", "-", "/", "|", "\\", "-" }, skipped = "", unknown = "" }, jump = { enabled = true }, log_level = 1, output = { enabled = true, open_on_run = "short" }, projects = { = { __index = } }, run = { enabled = true }, running = { concurrent = true }, status = { enabled = true, signs = true, virtual_text = false }, strategies = { integrated = { height = 40, width = 120 } }, summary = { animated = true, enabled = true, expand_errors = true, follow = true, mappings = { attach = "a", clear_marked = "M", clear_target = "T", debug = "d", debug_marked = "D", expand = { "", "<2-LeftMouse>" }, expand_all = "e", jumpto = "i", mark = "m", next_failed = "J", output = "o", prev_failed = "K", run = "r", run_marked = "R", short = "O", stop = "u", target = "t" } } } INFO | 2022-11-14T01:41:18Z+0700 | ...pack/packer/start/neotest/lua/neotest/lib/subprocess.lua:66 | CHILD | Connected to parent instance WARN | 2022-11-14T01:41:18Z+0700 | ...packer/start/neotest/lua/neotest/lib/treesitter/init.lua:182 | Using `build_position` or `position_id` functions with subprocess parsing is not supported, switch to using strings for remote calls WARN | 2022-11-14T01:41:18Z+0700 | ...packer/start/neotest/lua/neotest/lib/treesitter/init.lua:182 | Using `build_position` or `position_id` functions with subprocess parsing is not supported, switch to using strings for remote calls ```

I notice this part at the tail of my own config's log:

INFO | 2022-11-14T01:36:18Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:46 | Emitting test_focused event
DEBUG | 2022-11-14T01:36:18Z+0700 | .../packer/start/neotest/lua/neotest/client/events/init.lua:48 | Calling listener summary for event test_focused

versus

INFO | 2022-11-14T01:41:18Z+0700 | ...pack/packer/start/neotest/lua/neotest/lib/subprocess.lua:66 | CHILD | Connected to parent instance
WARN | 2022-11-14T01:41:18Z+0700 | ...packer/start/neotest/lua/neotest/lib/treesitter/init.lua:182 | Using `build_position` or `position_id` functions with subprocess parsing is not supported, switch to using strings for remote calls
WARN | 2022-11-14T01:41:18Z+0700 | ...packer/start/neotest/lua/neotest/lib/treesitter/init.lua:182 | Using `build_position` or `position_id` functions with subprocess parsing is not supported, switch to using strings for remote calls

The event test_focused looks sus to me. It seems to never stop calling :thinking:

rcarriga commented 1 year ago

Ah I think I see the issue

ERROR | 2022-11-14T01:36:09Z+0700 | ...te/pack/packer/start/neotest/lua/neotest/client/init.lua:274 | Couldn't find positions in path /home/ziontee113 .../pack/packer/start/neotest/lua/neotest/lib/file/find.lua:30: EACCES: permission denied: /home/ziontee113/pacman/var/cache/ldconfig

It looks like neotest-plenary is matching to your home directory which then fails during file finding because of that permission issue. Do you have a lua directory in your home by any chance? If so could you rename it and see if the problem still exists? If that's the issue then I should be able to resolve it quite easily :smile:

ziontee113 commented 1 year ago

OK it's resolved by removing lua directory in my Home directory. It's just an empty folder and idk why it's there :joy: Thank you very much @rcarriga :+1:

If that's the issue then I should be able to resolve it quite easily :smile:

I'll leave the closing of the issue to you :smile: . My issue has been resolved :partying_face:

rcarriga commented 1 year ago

Brilliant! I've added a fix to avoid using the home directory as a project root to avoid this in future

ziontee113 commented 1 year ago

Hi @rcarriga , I just updated my plugins today and ran into this problem yet again. My solution is yet again revert to an older commit, in this case a2424711213bf8c0c1afe81f5ffafb34c4f2da83.

rcarriga commented 1 year ago

Can you provide a new log so I can confirm the cause?

ziontee113 commented 1 year ago

@rcarriga , as I tried to reproduce the log, I updated neotest to the latest version. And it seems like everything is fine for now. I'll get back to you if I find something :+1: