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

Neotest adapter marks all tests in module as failed if one of the tests inside module fails #321

Closed
6 tasks done
AradiPatrik opened this issue Mar 26, 2024 · 2 comments · Fixed by #322
Closed
6 tasks done
Labels
bug Something isn't working

Comments

@AradiPatrik
Copy link

Have you read the docs and searched existing issues?

Neovim version (nvim -v)

v0.9.5

Operating system/version

macOS 14.3.1 (23D60)

Output of :checkhealth rustaceanvim

==============================================================================
rustaceanvim: require("rustaceanvim.health").check()

Checking for Lua dependencies ~
- OK [mfussenegger/nvim-dap](https://github.com/mfussenegger/nvim-dap) installed.

Checking external dependencies ~
- OK rust-analyzer: found rust-analyzer 1.76.0 (07dca489 2024-02-04)
- OK Cargo: found cargo 1.76.0 (c84b36747 2024-01-18)
- OK rustc: found rustc 1.76.0 (07dca489a 2024-02-04)
- OK lldb: found lldb-1500.0.404.7

Checking config ~
- OK No errors found in config.

Checking for conflicting plugins ~
- OK No conflicting plugins detected.

Checking for tree-sitter parser ~
- OK tree-sitter parser for Rust detected.

How to reproduce the issue

Install Neotest and the rustaceanvim adapter for it.

Create test module with multiple tests inside.

Run tests in the current file.

If both of them pass then both of them will have green checkmarks.
If one of them fail both of them will be marked with red cross --> This makes it harder to find the actual test that's failing.

Expected behaviour

When one of the tests is failing inside a test module mark only that as failing and leave the green checkmark for the other passing tests in the neotest summary. In short: only mark tests as failing that are actually failing.

Actual behaviour

If one test fails inside a test module all the tests inside that module will be marked as failing.

Untitled.mov

The minimal config used to reproduce this issue.

'nvim-neotest/neotest',
    dependencies = {
      'nvim-neotest/nvim-nio',
      'nvim-lua/plenary.nvim',
      'antoinemadec/FixCursorHold.nvim',
      'nvim-treesitter/nvim-treesitter',
    },
    opts = {
      adapters = { 'neotest-plenary' },
    },
    status = { virtual_text = true },
    output = { open_on_run = true },

require('neotest').setup {
-- ...,
adapters = {
-- ...,
require 'rustaceanvim.neotest',
},
}

@AradiPatrik AradiPatrik added the bug Something isn't working label Mar 26, 2024
@mrcjkb
Copy link
Owner

mrcjkb commented Mar 26, 2024

Thanks for reporting.

As of now, the neotest adapter only parses test failures. If you run the whole test module, it'll mark the module position as failed, which neotest interprets as all tests failing.
It should be possible to determine the positions of passed tests from the output, and mark them as such. I will look into it soon.

@AradiPatrik
Copy link
Author

Thanks!

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.

2 participants