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(summary): running files without tests causes animation loop #292

Closed
igorlfs opened this issue Mar 15, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@igorlfs
Copy link

igorlfs commented Mar 15, 2024

Neovim version (nvim -v)

NVIM v0.10.0-dev-2583+gbbb68e2a03

Operating system/version

Linux 6.7.7

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 0.3.1877-standalone
- OK Cargo: found cargo 1.76.0
- OK rustc: found rustc 1.76.0 (07dca489a 2024-02-04) (Arch Linux rust 1:1.76.0-2)
- OK debug adapter: found codelldb 

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

Open any file that doesn't contain any tests
:Neotest summary
Find the current file in the summary
Use `r` to run it

Expected behaviour

Files containing no tests shouldn't show up in the summary (as with other neotest adapters).

Actual behaviour

The running animation is shown eternally in the summary. Of course, nothing is actually being run.

The minimal config used to reproduce this issue.

-- Minimal nvim config with lazy
-- Assumes a directory in $NVIM_DATA_MINIMAL
-- Start with
--
-- export NVIM_DATA_MINIMAL=$(mktemp -d)
-- export NVIM_APP_NAME="nvim-ht-minimal"
-- nvim -u NORC -u minimal.lua
--
-- Then exit out of neovim and start again.

-- Ignore default config
local config_path = vim.fn.stdpath('config')
vim.opt.rtp:remove(config_path)

-- Ignore default plugins
local data_path = vim.fn.stdpath('data')
local pack_path = data_path .. '/site'
vim.opt.packpath:remove(pack_path)

-- bootstrap lazy.nvim
data_path = assert(os.getenv('NVIM_DATA_MINIMAL'), '$NVIM_DATA_MINIMAL environment variable not set!')
local lazypath = data_path .. '/lazy/lazy.nvim'
local uv = vim.uv
  ---@diagnostic disable-next-line: deprecated
  or vim.loop
if not uv.fs_stat(lazypath) then
  vim.fn.system {
    'git',
    'clone',
    '--filter=blob:none',
    'git@github.com:folke/lazy.nvim.git',
    '--branch=stable',
    lazypath,
  }
end
vim.opt.rtp:prepend(lazypath)

local lazy = require('lazy')

lazy.setup({
  {
    'mrcjkb/rustaceanvim',
    version = '^4',
    init = function()
      -- Configure rustaceanvim here
      vim.g.rustaceanvim = {}
    end,
    ft = { 'rust' },
  },
  -- Add any other plugins needed to reproduce the issue.
  -- see https://github.com/folke/lazy.nvim#-lazynvim for details.
  {
    "nvim-neotest/neotest",
    dependencies = { "nvim-lua/plenary.nvim", "mrcjkb/rustaceanvim" },
    config = function()
        require("neotest").setup({
            adapters = {
                require("rustaceanvim.neotest"),
            },
        })
    end,
    cmd = "Neotest",
}
}, { root = data_path, state = data_path .. '/lazy-state.json', lockfile = data_path .. '/lazy-lock.json' })
@igorlfs igorlfs added the bug Something isn't working label Mar 15, 2024
@mrcjkb
Copy link
Owner

mrcjkb commented Mar 15, 2024

Hey 👋

thanks for reporting 😄

I'm aware of this issue. See this discussion as to why I believe the fix should be neotest's responsibility.

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

No branches or pull requests

2 participants