Issafalcon / neotest-dotnet

Neotest adapter for dotnet
MIT License
73 stars 29 forks source link

"No test found" when using multiple adapters #108

Open Tantol opened 5 months ago

Tantol commented 5 months ago

I need help with setting neotest for full-stack development.

Whenever I run below configuration:

  {
    'nvim-neotest/neotest',
    dependencies = {
      'nvim-neotest/nvim-nio',
      'nvim-lua/plenary.nvim',
      'antoinemadec/FixCursorHold.nvim',
      'nvim-treesitter/nvim-treesitter',
      'Issafalcon/neotest-dotnet',
      'nvim-neotest/neotest-jest',
    },
    config = function()
      require('neotest').setup {
        adapters = {
          require 'neotest-jest',
          require 'neotest-dotnet',
        },
      }
    end,
  },

I get communicate "No test found" when trying to run dotnet test. Jest tests runs without any problem.

Below config works for dotnet tests (removed jest adapter):

  {
    'nvim-neotest/neotest',
    dependencies = {
      'nvim-neotest/nvim-nio',
      'nvim-lua/plenary.nvim',
      'antoinemadec/FixCursorHold.nvim',
      'nvim-treesitter/nvim-treesitter',
      'Issafalcon/neotest-dotnet',
      'nvim-neotest/neotest-jest',
    },
    config = function()
      require('neotest').setup {
        adapters = {
          require 'neotest-dotnet',
        },
      }
    end,
  },
Issafalcon commented 5 months ago

Hi @Tantol - Could you please provide the neotest logs (set to verbose) from when you use neotest-dotnet with and without multiple adapters, so I can see the difference. I can't reproduce what you're talking about at the moment.

Tantol commented 4 months ago

@Issafalcon yes, logs below:

Without jest-adapter

INFO | 2024-07-02T12:07:23Z+0200 | ...ocal/share/nvim/lazy/neotest/lua/neotest/config/init.lua:454 | Configuration complete INFO | 2024-07-02T12:07:43Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:33 | Starting child process INFO | 2024-07-02T12:07:43Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:36 | Parent address: localhost:38709 INFO | 2024-07-02T12:07:43Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:42 | Starting child process with command: /usr/bin/nvim --embed --headless -n INFO | 2024-07-02T12:07:43Z+0200 | ...ocal/share/nvim/lazy/neotest/lua/neotest/config/init.lua:454 | Configuration complete INFO | 2024-07-02T12:07:43Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:86 | CHILD | Connected to parent instance INFO | 2024-07-02T12:07:43Z+0200 | ...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:378 | Initialising client INFO | 2024-07-02T12:07:43Z+0200 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting starting event INFO | 2024-07-02T12:07:43Z+0200 | ...al/share/nvim/lazy/neotest/lua/neotest/adapters/init.lua:18 | Found 0 adapters for directory /home/xyz/project INFO | 2024-07-02T12:07:43Z+0200 | ...al/share/nvim/lazy/neotest/lua/neotest/adapters/init.lua:50 | Adapter neotest-dotnet matched buffer /home/xyz/project/plugins/api/commons/tests/UnitTests/Xyz.Commons.UnitTests/Utils/ReflectionUtilsTest.cs INFO | 2024-07-02T12:07:43Z+0200 | ...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:299 | Parsing /home/xyz/project/plugins/api/commons/tests/UnitTests/Xyz.Commons.UnitTests/Utils/ReflectionUtilsTest.cs INFO | 2024-07-02T12:07:43Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:153 | CHILD | Received remote call 1 <function 1> INFO | 2024-07-02T12:07:47Z+0200 | ...hare/nvim/lazy/neotest/lua/neotest/client/state/init.lua:57 | File discovered without root, using cwd /home/xyz/project/plugins/api/commons/tests/UnitTests/Xyz.Commons.UnitTests/Utils/ReflectionUtilsTest.cs INFO | 2024-07-02T12:07:47Z+0200 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting discover_positions event INFO | 2024-07-02T12:07:47Z+0200 | ...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:494 | Initialisation finished in 3.861 seconds INFO | 2024-07-02T12:07:47Z+0200 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting test_file_focused event INFO | 2024-07-02T12:07:47Z+0200 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting started event INFO | 2024-07-02T12:07:47Z+0200 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting run event INFO | 2024-07-02T12:07:47Z+0200 | ...nvim/lazy/neotest/lua/neotest/client/strategies/init.lua:34 | Starting process neotest-dotnet:/home/xyz/project-/home/xyz/project/plugins/api/commons/tests/UnitTests/Xyz.Commons.UnitTests/Utils/ReflectionUtilsTest.cs::ReflectionUtilsTest::GetAllEnumImplementationsByAttribute_ShouldReturnExpectedResult with strategy integrated INFO | 2024-07-02T12:07:48Z+0200 | ...nvim/lazy/neotest/lua/neotest/client/strategies/init.lua:54 | Process for position neotest-dotnet:/home/xyz/project-/home/xyz/project/plugins/api/commons/tests/UnitTests/Xyz.Commons.UnitTests/Utils/ReflectionUtilsTest.cs::ReflectionUtilsTest::GetAllEnumImplementationsByAttribute_ShouldReturnExpectedResult exited with code 1 INFO | 2024-07-02T12:07:48Z+0200 | ...zy/neotest-dotnet/lua/neotest-dotnet/utils/trx-utils.lua:14 | Parsing trx file: /tmp/nvim.zenon/3ejmUF/1.trx ERROR | 2024-07-02T12:07:48Z+0200 | ...zy/neotest-dotnet/lua/neotest-dotnet/utils/trx-utils.lua:18 | No test output file found INFO | 2024-07-02T12:07:48Z+0200 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting results event INFO | 2024-07-02T12:07:48Z+0200 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting results event INFO | 2024-07-02T12:07:54Z+0200 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting test_focused event INFO | 2024-07-02T12:07:56Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:20 | Closing child channel INFO | 2024-07-02T12:07:57Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:46 | Child process exited

With

INFO | 2024-07-02T12:05:05Z+0200 | ...ocal/share/nvim/lazy/neotest/lua/neotest/config/init.lua:454 | Configuration complete INFO | 2024-07-02T12:05:30Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:33 | Starting child process INFO | 2024-07-02T12:05:30Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:36 | Parent address: localhost:41557 INFO | 2024-07-02T12:05:30Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:42 | Starting child process with command: /usr/bin/nvim --embed --headless -n INFO | 2024-07-02T12:05:30Z+0200 | ...ocal/share/nvim/lazy/neotest/lua/neotest/config/init.lua:454 | Configuration complete INFO | 2024-07-02T12:05:30Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:86 | CHILD | Connected to parent instance INFO | 2024-07-02T12:05:30Z+0200 | ...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:378 | Initialising client INFO | 2024-07-02T12:05:30Z+0200 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting starting event INFO | 2024-07-02T12:05:30Z+0200 | ...al/share/nvim/lazy/neotest/lua/neotest/adapters/init.lua:18 | Found 1 adapters for directory /home/xyz/project INFO | 2024-07-02T12:05:30Z+0200 | ...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:494 | Initialisation finished in 0 seconds INFO | 2024-07-02T12:05:30Z+0200 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting started event INFO | 2024-07-02T12:05:36Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:20 | Closing child channel INFO | 2024-07-02T12:05:36Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:46 | Child process exited

Issafalcon commented 4 months ago

Just as an update on this, I haven't forgotten about this issue. I just have no time at the moment to dedicate to looking into it, having a new baby to look after.