nvim-neotest / neotest

An extensible framework for interacting with tests within NeoVim.
MIT License
2.26k stars 110 forks source link

[BUG] Slow starup time #445

Open GopherJ opened 1 month ago

GopherJ commented 1 month ago

NeoVim Version NVIM v0.10.1 Build type: Debug LuaJIT 2.1.1713484068 Run "nvim -V1 -v" for more info

Describe the bug require('neotest').setup({ adapters = { require('neotest-go')({ experimental = { test_table = true, }, args = { '-count=1', '-timeout=60s' } }), -- require('neotest-python')({}), -- require('neotest-gtest').setup({}) } }) will add seconds of startup time

To Reproduce Please provide a minimal init.lua to reproduce which can be run as the following:

nvim --clean -u minimal.lua

You can edit the following example file to include your adapters and other required setup.

vim.opt.runtimepath:remove(vim.fn.expand("~/.config/nvim"))
vim.opt.packpath:remove(vim.fn.expand("~/.local/share/nvim/site"))

local lazypath = "/tmp/lazy/lazy.nvim"

if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end

vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
  "nvim-neotest/neotest",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "nvim-treesitter/nvim-treesitter",
    -- Install adapters here
  },
  config = function()
    -- Install any required parsers
    require("nvim-treesitter.configs").setup({
      ensure_installed = {},
    })

    require("neotest").setup({
      -- Add adapters to the list
      adapters = {},
    })
  end,
})

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Please provide example test files to reproduce.

Expected behavior A clear and concise description of what you expected to happen.

Logs

  1. Wipe the neotest.log file in stdpath("log") or stdpath("data").
  2. Set log_level = vim.log.levels.DEBUG in your neotest setup config.
  3. Reproduce the issue.
  4. Provide the new logs.

Additional context Add any other context about the problem here.

GopherJ commented 1 month ago

To reproduce: https://github.com/GopherJ/dotfiles/blob/master/coc/.vimrc

Edit: fixed in https://github.com/GopherJ/dotfiles/commit/8a08433420393b423891605a685a8482346c07f8

GopherJ commented 1 month ago

Ref: #380