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

Nothing happens when running tests #25

Closed
natewallis opened this issue May 30, 2023 · 7 comments
Closed

Nothing happens when running tests #25

natewallis opened this issue May 30, 2023 · 7 comments

Comments

@natewallis
Copy link

Hi,

I am using Lazy to load plugins into NVIM and I am getting no feedback when running

lua require("neotest").run.run()

Here is my NVIM config for testing. I had previously installed vim-test, but then saw the developer was moving to a new project, so I installed that instead.

return {
  {
    -- wrapper for running tests of different granularities   You • Mon 22 May 09:55:56 2023 • comments and removes modules
    -- 'vim-test/vim-test',
    {
      'nvim-neotest/neotest',
      dependencies = {
        'nvim-lua/plenary.nvim',
        'nvim-treesitter/nvim-treesitter',
        'antoinemadec/FixCursorHold.nvim',
        'jfpedroza/neotest-elixir'
      },
      config = function()
        require('neotest').setup({
          adapters = {
            require('neotest-elixir')
          }
        })
      end
    },
    'jfpedroza/neotest-elixir',
  }
}

When I attempt to run the tests, it does nothing and I see no running tests. I am running the tests inside a vanilla scaffolded phoenix project.

Should I see a popup on the screen with test results?

@jfpedroza
Copy link
Owner

Hey, sorry. Were you able to solve it?

@garaujodev
Copy link

garaujodev commented Sep 19, 2023

Hello @jfpedroza

I'm getting related behavior. I'm using Lazyvim too. When I run neotest I got No test found message.

Any suggestions?

@jfpedroza
Copy link
Owner

Does it happen only with Elixir? Have you tried another adapter?

@em-jones
Copy link

@garaujodev the only solution I've been able to come up with is to set the lazy setting to false :/

@em-jones
Copy link

another solution i just found involves setting the typical config setup step to the init function.

This is less-than ideal as it's going to mean initializing a neotest adapter I might not ever use. But, at least it doesn't load the entire plugin 🤷

@jfpedroza I can confirm that using ft-based lazy-loading for python's neotest-python adapter works just fine.

@jfpedroza
Copy link
Owner

jfpedroza commented Nov 24, 2023

I recently migrated from packer to lazy and haven't really tried lazy loading. I have my config in after/plugin/neotest.lua.

As I understand it, if you specify all the adapters in neotest.setup(), they will all be loaded together. If you want to load the adapter only if you need it, you should use neotest.setup_project() to set up the adapters for a specific project.

For example, I have in my .nvim.lua in my Elixir project:

vim.schedule(function()
  require("neotest").setup_project(vim.loop.cwd(), {
    adapters = {
      require("neotest-elixir")({
        mix_task = "test.interactive",
        extra_formatters = { "ExUnit.CLIFormatter", "ExUnitNotifier" },
      }),
    },
  })
end)

Adapters are not standalone neovim plugins. They are always loaded by a call when you are setting up neotest.

@jfpedroza
Copy link
Owner

Closing as stale.

@jfpedroza jfpedroza closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2025
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

No branches or pull requests

4 participants