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

check for nil testsuite when parsing test results #63

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

tylersouthwick
Copy link
Contributor

@tylersouthwick tylersouthwick commented Nov 21, 2023

If a project has no tests and neotrest tries to run tests, no tests are found.
If a project has tests, and the tests are removed, and then neotest tries to run tests, it gets the following error:

neotest-rust: ~/.local/share/nvim/lazy/neotest/lua/nio/init.lua:105: The coroutine failed with this message:                                                                 
...l/share/nvim/lazy/neotest-rust/lua/neotest-rust/init.lua:362: attempt to get length of field 'testsuite' (a nil value)                                                              
stack traceback:                                                                                                                                                                       
        ...l/share/nvim/lazy/neotest-rust/lua/neotest-rust/init.lua: in function 'results'                                                                                             
        ...al/share/nvim/lazy/neotest/lua/neotest/client/runner.lua:131: in function '_run_spec'                                                                                       
        ...al/share/nvim/lazy/neotest/lua/neotest/client/runner.lua:89: in function <...al/share/nvim/lazy/neotest/lua/neotest/client/runner.lua:88>  

this fixes #32 and adds unit test to the change in #33

Copy link
Owner

@rouge8 rouge8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable. Please run pre-commit to format the files and I’ll approve it!

@tylersouthwick
Copy link
Contributor Author

This seems reasonable. Please run pre-commit to format the files and I’ll approve it!

ran pre-commit and rebased

Copy link
Owner

@rouge8 rouge8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@rouge8 rouge8 merged commit 46428d9 into rouge8:main Nov 21, 2023
2 checks passed
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 this pull request may close these issues.

Error attempt to get length of field 'testsuite' (a nil value)
2 participants