Issafalcon / neotest-dotnet

Neotest adapter for dotnet
MIT License
71 stars 27 forks source link

xUnit example issue #70

Closed thegrumpylion closed 10 months ago

thegrumpylion commented 1 year ago

followed this tutorial for testing https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-dotnet-test

this is the neotest.log with debug enabled. i am not sure what is actually relevant so i apologize if this is too much.

hope is useful.

DEBUG | 2023-08-30T20:23:43Z+0300 | ...hare/nvim/lazy/neotest/lua/neotest/client/state/init.lua:85 | Setting positions to running /home/nikolas/tests/cs-options/PrimeService.Tests/PrimeService_IsPrimeShould.cs
INFO | 2023-08-30T20:23:43Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting run event
DEBUG | 2023-08-30T20:23:43Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener status for event run
DEBUG | 2023-08-30T20:23:43Z+0300 | ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:114 | neotest-dotnet: Creating specs from Tree (as list):
DEBUG | 2023-08-30T20:23:43Z+0300 | ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:115 | { {
    id = "/home/nikolas/tests/cs-options/PrimeService.Tests/PrimeService_IsPrimeShould.cs",
    name = "PrimeService_IsPrimeShould.cs",
    path = "/home/nikolas/tests/cs-options/PrimeService.Tests/PrimeService_IsPrimeShould.cs",
    type = "file"
  } }
DEBUG | 2023-08-30T20:23:43Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event run
DEBUG | 2023-08-30T20:23:43Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener state for event run
DEBUG | 2023-08-30T20:23:43Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener diagnostic for event run
DEBUG | 2023-08-30T20:23:43Z+0300 | ...e/nvim/lazy/neotest/lua/neotest/consumers/diagnostic.lua:55 | Setting diagnostics for /home/nikolas/tests/cs-options/PrimeService.Tests/PrimeService_IsPrimeShould.cs {}
DEBUG | 2023-08-30T20:23:43Z+0300 | ...est-dotnet/lua/neotest-dotnet/utils/build-spec-utils.lua:52 | neotest-dotnet: Running tests using command: dotnet test /home/nikolas/tests/cs-options/PrimeService.Tests  --results-directory /tmp/nvim.nikolas/lDvLIr --logger "trx;logfilename=2.trx"
DEBUG | 2023-08-30T20:23:43Z+0300 | ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:121 | neotest-dotnet: Created 1 specs, with contents:
DEBUG | 2023-08-30T20:23:43Z+0300 | ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:122 | { {
    command = 'dotnet test /home/nikolas/tests/cs-options/PrimeService.Tests  --results-directory /tmp/nvim.nikolas/lDvLIr --logger "trx;logfilename=2.trx"',
    context = {
      file = "/home/nikolas/tests/cs-options/PrimeService.Tests/PrimeService_IsPrimeShould.cs",
      id = "/home/nikolas/tests/cs-options/PrimeService.Tests/PrimeService_IsPrimeShould.cs",
      results_path = "/tmp/nvim.nikolas/lDvLIr/2.trx"
    }
  } }
INFO | 2023-08-30T20:23:43Z+0300 | ...nvim/lazy/neotest/lua/neotest/client/strategies/init.lua:34 | Starting process neotest-dotnet:/home/nikolas/tests/cs-options-/home/nikolas/tests/cs-options/PrimeService.Tests/PrimeService_IsPrimeShould.cs with strategy integrated
DEBUG | 2023-08-30T20:23:43Z+0300 | ...nvim/lazy/neotest/lua/neotest/client/strategies/init.lua:35 | Strategy spec {
  command = 'dotnet test /home/nikolas/tests/cs-options/PrimeService.Tests  --results-directory /tmp/nvim.nikolas/lDvLIr --logger "trx;logfilename=2.trx"',
  context = {
    file = "/home/nikolas/tests/cs-options/PrimeService.Tests/PrimeService_IsPrimeShould.cs",
    id = "/home/nikolas/tests/cs-options/PrimeService.Tests/PrimeService_IsPrimeShould.cs",
    results_path = "/tmp/nvim.nikolas/lDvLIr/2.trx"
  },
  strategy = {
    height = 40,
    width = 120
  }
}
INFO | 2023-08-30T20:23:45Z+0300 | ...nvim/lazy/neotest/lua/neotest/client/strategies/init.lua:54 | Process for position neotest-dotnet:/home/nikolas/tests/cs-options-/home/nikolas/tests/cs-options/PrimeService.Tests/PrimeService_IsPrimeShould.cs exited with code 0
DEBUG | 2023-08-30T20:23:45Z+0300 | ...nvim/lazy/neotest/lua/neotest/client/strategies/init.lua:56 | Output of process  /tmp/nvim.nikolas/lDvLIr/3
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:160 | neotest-dotnet: Fetching results from neotest tree (as list):
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:161 | { {
    id = "/home/nikolas/tests/cs-options/PrimeService.Tests/PrimeService_IsPrimeShould.cs",
    name = "PrimeService_IsPrimeShould.cs",
    path = "/home/nikolas/tests/cs-options/PrimeService.Tests/PrimeService_IsPrimeShould.cs",
    type = "file"
  } }
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:165 | neotest-dotnet: Test Nodes:
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:166 | {}
INFO | 2023-08-30T20:23:45Z+0300 | ...zy/neotest-dotnet/lua/neotest-dotnet/utils/trx-utils.lua:14 | Parsing trx file: /tmp/nvim.nikolas/lDvLIr/2.trx
DEBUG | 2023-08-30T20:23:45Z+0300 | ...al/share/nvim/lazy/neotest/lua/neotest/lib/file/init.lua:22 | Reading file: /tmp/nvim.nikolas/lDvLIr/2.trx
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:172 | neotest-dotnet: TRX Results Output:
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:173 | {
  UnitTestResult = {
    _attr = {
      computerName = "lat-552",
      duration = "00:00:00.0015188",
      endTime = "2023-08-30T20:23:45.0627211+03:00",
      executionId = "be6cedbb-4b54-4a52-87ac-32d66c94cd42",
      outcome = "Passed",
      relativeResultsDirectory = "be6cedbb-4b54-4a52-87ac-32d66c94cd42",
      startTime = "2023-08-30T20:23:45.0627009+03:00",
      testId = "8f003bfd-dccc-83bc-2740-33119fb6f92f",
      testListId = "8c84fa94-04c1-424b-9868-57a2d4851a1d",
      testName = "Prime.UnitTests.Services.PrimeService_IsPrimeShould.IsPrime_InputIs1_ReturnFalse",
      testType = "13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b"
    }
  }
}
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:175 | neotest-dotnet: TRX Test Definitions Output:
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:176 | {
  UnitTest = {
    Execution = {
      _attr = {
        id = "be6cedbb-4b54-4a52-87ac-32d66c94cd42"
      }
    },
    TestMethod = {
      _attr = {
        adapterTypeName = "executor://xunit/VsTestRunner2/netcoreapp",
        className = "Prime.UnitTests.Services.PrimeService_IsPrimeShould",
        codeBase = "/home/nikolas/tests/cs-options/PrimeService.Tests/bin/Debug/net7.0/PrimeService.Tests.dll",
        name = "IsPrime_InputIs1_ReturnFalse"
      }
    },
    _attr = {
      id = "8f003bfd-dccc-83bc-2740-33119fb6f92f",
      name = "Prime.UnitTests.Services.PrimeService_IsPrimeShould.IsPrime_InputIs1_ReturnFalse",
      storage = "/home/nikolas/tests/cs-options/primeservice.tests/bin/debug/net7.0/primeservice.tests.dll"
    }
  }
}
INFO | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:196 | neotest-dotnet: Found 0 test results when parsing TRX file: /tmp/nvim.nikolas/lDvLIr/2.trx
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:203 | neotest-dotnet: Intermediate Results:
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:204 | { {
    raw_output = "passed",
    status = "passed",
    test_name = "Prime.UnitTests.Services.PrimeService_IsPrimeShould.IsPrime_InputIs1_ReturnFalse"
  } }
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:209 | neotest-dotnet: Neotest Results after conversion of Intermediate Results:
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest-dotnet/lua/neotest-dotnet/init.lua:210 | {}
DEBUG | 2023-08-30T20:23:45Z+0300 | ...hare/nvim/lazy/neotest/lua/neotest/client/state/init.lua:70 | New results for adapter neotest-dotnet:/home/nikolas/tests/cs-options
INFO | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting results event
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener status for event results
DEBUG | 2023-08-30T20:23:45Z+0300 | ...hare/nvim/lazy/neotest/lua/neotest/client/state/init.lua:70 | New results for adapter neotest-dotnet:/home/nikolas/tests/cs-options
INFO | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting results event
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener status for event results
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener state for event results
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener diagnostic for event results
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener state for event results
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener diagnostic for event results
DEBUG | 2023-08-30T20:23:45Z+0300 | ...e/nvim/lazy/neotest/lua/neotest/consumers/diagnostic.lua:55 | Setting diagnostics for /home/nikolas/tests/cs-options/PrimeService.Tests/PrimeService_IsPrimeShould.cs {}
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener quickfix for event results
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener output_panel for event results
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event results
DEBUG | 2023-08-30T20:23:45Z+0300 | ...e/nvim/lazy/neotest/lua/neotest/consumers/diagnostic.lua:55 | Setting diagnostics for /home/nikolas/tests/cs-options/PrimeService.Tests/PrimeService_IsPrimeShould.cs {}
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener quickfix for event results
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener output for event results
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener output_panel for event results
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event results
DEBUG | 2023-08-30T20:23:45Z+0300 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lu   0 | Calling listener output for event results
Issafalcon commented 1 year ago

Hi @thegrumpylion - It all looks like it's fine until it tries to convert the intermediate results, which is unusual.

I'll try and reproduce when I get some time.

Issafalcon commented 11 months ago

Hi @thegrumpylion - Sorry for the delay. Just got round to trying to reproduce this, but everything looks like it's working fine for me.

If you're still having the issue, could you add your current neotest configuration (with the adapters) and the version of neovim you're using. Also please ensure that you're updated to the latest versions of neotest and neotest-dotnet.

rudiejd commented 11 months ago

I have a similar issue here, but with NUnit: https://github.com/Issafalcon/neotest-dotnet/issues/73. What Neovim version are you on?

Issafalcon commented 10 months ago

Closing this issue due to inactivity.

Please feel free to open another issue if this issue is still occuring.