-
Notifications
You must be signed in to change notification settings - Fork 679
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
[Unit Test] Cannot run unit tests from VSCode when using NUnit's TestFixtureSource #1734
Comments
Just noting that the duplicate entries in logs and a popup with "Failed to start debugger: null" error on a second try with "debug this" seems to be an unrelated bug as the same happens when the debugger fails to start due to a compilation error or when clicking again "debug this" too fast on a test not triggering original bug. |
Is there any updates on it? It seems I face the same issue now. |
This is still a problem and prevents the use of NUnit's {
"Request_seq": 135,
"Command": "/v2/debugtest/getstartinfo",
"Running": true,
"Success": false,
"Message": "\"System.NullReferenceException: Object reference not set to an instance of an object\\n at OmniSharp.DotNetTest.VSTestManager.DebugGetStartInfoAsync (System.String[] methodNames, System.String runSettings, System.String testFrameworkName, System.String targetFrameworkVersion, System.Threading.CancellationToken cancellationToken) [0x00113] in <4f61ed4d73fa416e988571e27def90ec>:0 \\n at OmniSharp.Endpoint.EndpointHandler`2[TRequest,TResponse].GetFirstNotEmptyResponseFromHandlers (OmniSharp.Endpoint.Exports.ExportHandler`2[TRequest,TResponse][] handlers, TRequest request) [0x00099] in <def28aea2ee84c5d8f408bdb08c9c4ba>:0 \\n at OmniSharp.Endpoint.EndpointHandler`2[TRequest,TResponse].HandleRequestForLanguage (System.String language, TRequest request, OmniSharp.Protocol.RequestPacket packet) [0x00163] in <def28aea2ee84c5d8f408bdb08c9c4ba>:0 \\n at OmniSharp.Endpoint.EndpointHandler`2[TRequest,TResponse].Process (OmniSharp.Protocol.RequestPacket packet, OmniSharp.Endpoint.LanguageModel model, Newtonsoft.Json.Linq.JToken requestObject) [0x0024b] in <def28aea2ee84c5d8f408bdb08c9c4ba>:0 \\n at OmniSharp.Stdio.Host.HandleRequest (System.String json, Microsoft.Extensions.Logging.ILogger logger) [0x000e7] in <bc69fa58846f4d298e971dab810bd026>:0 \"",
"Body": null,
"Seq": 254,
"Type": "response"
} My configuration:
VS Code version: 1.51.1 Restarting Omnisharp and/or VS Code makes no difference. |
I'm currently also experiencing this same issue with the following configuration: VS Code Version: 1.74.3 Has there been any progress on this or at least a work around? |
The C# extension has a minimal unit testing experience that may not work with every testing framework feature. The C# DevKit has a more robust unit testing experience. |
I'm not sure whether this is a C# extension's bug or NUnit, filing here as when running
dotnet test
everything works.Environment data
dotnet --info
output:VS Code version: Version 1.15.1
C# Extension version: 1.12.1
Steps to reproduce
Extract VSCodeBug.zip and open it in VS Code. After restoring packages click "run test" or "debug test" on method
Test
.The project uses NUnit and its TestFixtureSourceAttribute to run the test fixture multiple times with different data.
Expected behavior
When placing breakpoint at the beginning of the mehod and clicking "debug test" the debugger should hit the breakpoint.
When clicking "run test" the test should be executed 10 times with results in log.
Actual behavior
When I click "debug test" I see:
and nothing happens, no breakpoint is hit, after clicking "debug test" again I get:
Notice the duplicate entries, also a popup with "Failed to start debugger: null" error shows. A new entry is added after every run (after 5 runs, the messages are duplicated 5 times).
When I click ''run tests" I see:
So VS Code haven't found any test to run.
When executing the same code with
dotnet test
I see:So from command line everything works.
When I remove the
TestFixtureSourceAttribute
and a ctor from the class and invoke it from VSCode, 1 test is run, so this case is working correctly, the problem is when using TestFixtureSourceAttribute.The text was updated successfully, but these errors were encountered: