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

nil error on test single function #47

Closed
zankich opened this issue May 8, 2023 · 5 comments · Fixed by #48
Closed

nil error on test single function #47

zankich opened this issue May 8, 2023 · 5 comments · Fixed by #48

Comments

@zankich
Copy link

zankich commented May 8, 2023

Hi!

When I run require('neotest').run.run() on a single function with a failing test I get the following stacktrace:

2023-05-08T14:38:41 Neotest ﭧ WARN neotest-go: ...nkich/.local/share/nvim/plugged/neotest/lua/nio/init.lua:105: The coroutine failed with this message:
...al/share/nvim/plugged/neotest-go/lua/neotest-go/init.lua:223: attempt to index a nil value
stack traceback:
        ...al/share/nvim/plugged/neotest-go/lua/neotest-go/init.lua: in function 'results'
        ...share/nvim/plugged/neotest/lua/neotest/client/runner.lua:131: in function '_run_spec'
        ...share/nvim/plugged/neotest/lua/neotest/client/runner.lua:89: in function <...share/nvim/plugged/neotest/lua/neotest/client/runner.lua:88>

Reverting back to 2148ad794e7a5c30c7385a3281f4be91e6b113c4 and executing against the same function I get the proper failed test output.

I was able to reproduce the error with a simple testcase

package main

import "testing"

func TestStackTrace(t *testing.T) {
        t.FailNow()
}

Testing that function with b6dc0b1c49569273d863d7b96b6c81b3fc153e82 will throw a stacktrace while testing with 2148ad794e7a5c30c7385a3281f4be91e6b113c4 correctly reports the error.

@sergii4
Copy link
Collaborator

sergii4 commented May 9, 2023

Hi @zankich, I could reproduce it only once from 10 attempts. Do you have clean steps to reproduce?

@Snikimonkd
Copy link

Snikimonkd commented May 10, 2023

i have the same problem on every call of require("neotest").run.run(), i don't know how to check plugin's commit, but i tried to update it with :PackerSync, so i can assume that this problem reproduces with the latest versions of neotest and neotest-go

UPD
tried with 3 last tags of neotest - reproduces on all tags

@zankich
Copy link
Author

zankich commented May 10, 2023

I got a PR which fixed the issues for me #49

@sergii4
Copy link
Collaborator

sergii4 commented May 11, 2023

Hi @zankich, I believe @michaldziurowski fixed issue in #48. Could you please update plugin and test if it works on your side?

@tauraamui
Copy link

tauraamui commented May 14, 2023

How can I update the neotest-go runner specifically? I am also experiencing this bug and I would like to acquire the fix. Oh I see, it's just its own plugin entry. I suppose I'll have to reload my neovim instance to see the fix has applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants