Open lyz-code opened 1 year ago
Apologies for the late response, I somehow missed this issue :sweat_smile:
Are you still experiencing this? The log file can found by running the command :echo stdpath("log")
which will print a directory where there is a neotest.log
file (or there will be when the log level is set to debug). Please delete the file, reproduce the issue and paste the new file that is created here
This also happened to me using the rspec plugin.
After deleting the ~/.local/state/nvim/neotest.log
and closing neovim when I run the spec the state matches the results and I can't reproduce it now. If this happens to me again I'll try to get the logs and paste them here
I got an error on the file
❯ cat ~/.local/state/nvim/neotest.log
WARN | 2023-02-27T16:27:17Z+0000 | ...pack/packer/start/neotest/lua/neotest/lib/subprocess.lua:156 | CHILD | Error in remote call Vim:E117: Unknown function: test#test_file
stack traceback:
[C]: in function 'test#test_file'
...ker/start/neotest-vim-test/lua/neotest-vim-test/init.lua:38: in function 'func'
...pack/packer/start/neotest/lua/neotest/lib/subprocess.lua:148: in function <...pack/packer/start/neotest/lua/neotest/lib/subprocess.lua:147>
[C]: in function 'xpcall'
...pack/packer/start/neotest/lua/neotest/lib/subprocess.lua:147: in function <...pack/packer/start/neotest/lua/neotest/lib/subprocess.lua:146>
Everytime I delete the file and try again it works again
That error is because the vim-test adapter is being use (is that the correct adapter?) and vim-test is likely being lazy loaded. You should configure vim-test to be loaded with neotest-vim-test. Please open a separate issue if you have further problems, as this is unrelated to this issue.
Hi @rcarriga , I'm not sure whether it was best to add to this issue or create a new one.
I'm having a similar scenario as @kevinrobayna using RSpec, I am however, only using neotest. Basically when I launch nvim for the first time and go to a repo containing multiple _spec.rb files, the first file I pick to run the tests shows the correct sign. But then all subsequent tests for other _spec.rb files (in the same directory) show the wrong sign.
My neotest.log file is empty, and my config is the followoing:
{
"nvim-neotest/neotest",
lazy = true,
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"antoinemadec/FixCursorHold.nvim",
"olimorris/neotest-rspec",
},
config = function()
require("neotest").setup {
adapters = {
require "neotest-rspec",
},
icons = {
passed = "",
running = "",
failed = "",
unknown = "",
},
quickfix = { open = false },
status = { virtual_text = false },
output = { open_on_run = false },
lazy = true,
}
end,
},
See the screenshots attached.
Correct:
Wrong:
Cheers and thank you!
I had just set up neotest with the neotest-python adapter for the first time and was running into this issue. Here's a log file (I believe I ran all the tests in the file a couple of times, and then ran some individual tests afterwards). In all cases, the tests pass but they're marked by neotest as failing.
I noticed that this doesn't happen on other projects. The test suite of https://github.com/pytest-dev/pytest (which unsurprisingly also uses pytest) marks passing tests as passing.
The screenshot in my previous comment is of https://github.com/python-poetry/poetry, where passing tests are incorrectly marked as failing.
It looks like this might be related to parallel tests runs (at least in my case):
Removing the -n
option here that tells pytest to use that many subprocesses makes the tests get marked correctly.
Created this repo with a minimal repro for the issue I ran into with pytest: https://github.com/neeerp/parallel-neotest-bug-repro
Is there any way to disable this icon? just until solve this issue?
NeoVim Version
Describe the bug When I run any python test it's marked as failed in the status line
To Reproduce Please provide a minimal
init.lua
to reproduce which can be run as the following:You can edit the following example file to include your adapters and other required setup.
Steps to reproduce the behavior:
:NeotestNearest
Please provide example test files to reproduce.
Expected behavior Passing tests are marked as passed
Logs
neotest.log
file instdpath("log")
orstdpath("data")
.log_level = vim.log.levels.DEBUG
in your neotest setup config.I don't understand the instructions to wipe the log or where to find it, if you help me locate it I can give it to you
Additional context Add any other context about the problem here.![failed_test](https://user-images.githubusercontent.com/24810987/214571804-76f7412a-91d8-45c3-88cb-46234bb61744.jpg)