Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: tests don't start, crash from nio #61

Closed
2 tasks done
asfaltboy opened this issue Jun 27, 2024 · 5 comments · Fixed by #63
Closed
2 tasks done

bug: tests don't start, crash from nio #61

asfaltboy opened this issue Jun 27, 2024 · 5 comments · Fixed by #63
Labels
bug Something isn't working

Comments

@asfaltboy
Copy link

Did you check docs and existing issues?

Neovim version (nvim -v)

v0.10.0

Operating system/version

MacOS 14.5

Describe the bug

Whenever I try to run tests with latest version of nio, neotest, and neotest-golang, I see this error:

neotest-golang: ...vchenko/.local/share/nvim/lazy/nvim-nio/lua/nio/init.lua:119: The coroutine failed with this message: 
vim/shared.lua:0: dst: expected table, got nil
stack traceback:
	[C]: in function 'error'
	vim/shared.lua: in function 'validate'
	vim/shared.lua: in function 'list_extend'
	.../lazy/neotest-golang/lua/neotest-golang/runspec_test.lua:27: in function 'build_spec'
	...al/share/nvim/lazy/neotest/lua/neotest/client/runner.lua:76: in function '_run_tree'
	...al/share/nvim/lazy/neotest/lua/neotest/client/runner.lua:144: in function <...al/share/nvim/lazy/neotest/lua/neotest/client/runner.lua:143>
stack traceback:
	...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:89: in function <...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:88>
	[C]: in function 'error'
	...vchenko/.local/share/nvim/lazy/nvim-nio/lua/nio/init.lua:119: in function 'gather'
	...al/share/nvim/lazy/neotest/lua/neotest/client/runner.lua:153: in function '_run_broken_down_tree'
	...al/share/nvim/lazy/neotest/lua/neotest/client/runner.lua:79: in function '_run_tree'
	...al/share/nvim/lazy/neotest/lua/neotest/client/runner.lua:65: in function <...al/share/nvim/lazy/neotest/lua/neotest/client/runner.lua:22>
	[C]: in function 'xpcall'
	...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:84: in function 'run_tree'
	...al/share/nvim/lazy/neotest/lua/neotest/consumers/run.lua:73: in function 'func'
	...chenko/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:173: in function <...chenko/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:172>

Whether I select a specific test, or all tests in a file. Same tests run ok when using neotest-go instead

Steps To Reproduce

  1. run neotest on a go file

Expected Behavior

Should run tests

@asfaltboy asfaltboy added the bug Something isn't working label Jun 27, 2024
@fredrikaverpil
Copy link
Owner

fredrikaverpil commented Jun 28, 2024

Hi @asfaltboy and thanks for the report. I can't reproduce this on my end. What does your neotest config look like, and how do you register the load neotest-golang along with any options?

It looks like the go_test_args option (here) is somehow set to nil on your end, which is not a valid value.

@uroborosq
Copy link

Having the same issue with default config:

return {
    {
        "nvim-neotest/neotest",
        dependencies = {
            "nvim-neotest/nvim-nio",
            "nvim-lua/plenary.nvim",
            "antoinemadec/FixCursorHold.nvim",
            "nvim-treesitter/nvim-treesitter",
            "fredrikaverpil/neotest-golang",
        },
        config = function()
            require("neotest").setup {
                adapters = {
                    require "neotest-golang", 
                },
            }
        end,
    },
}

Issue doesn't reproduce with 'extra everything' config from README

@fredrikaverpil
Copy link
Owner

Thanks for the details. I believe I might have found the issue and I've pushed a PR.

Could you please help me out and see if this fixes this issue on your end?
You can temporarily set the branch used in #63.

{
  "fredrikaverpil/neotest-golang",
  branch = "fix/options",
},

@uroborosq
Copy link

@fredrikaverpil yes, now it's fine. Thanks)

@fredrikaverpil
Copy link
Owner

Many thanks for the confirmation @uroborosq, I'm glad to hear this got fixed on your end as well 🥳

@asfaltboy I'm going to merge this fix in straight away as this was a significant mistake on my end. Please re-open this issue if it did not fix the problem on your end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants