-
Notifications
You must be signed in to change notification settings - Fork 675
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
"Failed to start debugger: null" exception when debugging NUnit #1434
Comments
We've been specifically waiting until there are NUnit bits that we can support. |
Once NUnit is ready we can add support in OmniSharp. Until then, it likely won't work. |
I tried using this project and am getting the following output coming back from NUnit:
|
Hello @DustinCampbell!
But the NUnit Adapter is in "alpha" version yet. |
@bernardbr: I did not run |
I get the same output as you do when running |
I did it too, and works fine:
But before I ran Note: I am using Windows |
Sorry for not being clear @bernardbr: You'll get different output than I am because I've built from this PR: OmniSharp/omnisharp-roslyn#833, which increases output during test discovery. |
I don't think the test is actually passing on your machine. If you debug omnisharp-vscode, you'll find that there aren't any test results. It looks like there's a bug in omnisharp-vscode that is writing "Test passed" if no test runs. |
Ah ok, I understood! Anyway, I think it would be better to close this problem and wait for a final version of NUnit. And then, try again! What do you think? |
I think the problem is related to this comment in the PR you linked:
|
You're right! |
Not a problem @bernardbr. Thanks very for posting here. I'm anxious to get NUnit working. xUnit is in good shape, but NUnit is sorely missing. |
I'm converting a NetFramework4's legacy code to netcore, and all unit tests are written with NUnit. |
@DustinCampbell the adapter is working fine in Visual Studio right now, the only issue we are having is calling vstest.console directly from the command line. How does VSCode interface with the test adapter? I would assume that it is slightly different than Visual Studio. Looking at our code for the callstack you have above, I looks to me that the |
@rprouse: We don't actually interface with the test adapter directly. VS Code interfaces with the test adapter through OmniSharp by calling After building a test project with
We then communicate over the port passed to We don't do anything fancy and it works for the xUnit test adapter. I agree that it's weird that |
@DustinCampbell thanks for the info. Just knowing that OmniSharp uses For those that are tracking this issue, the fix for this may have to wait until |
Also pinging @singhsarab in case he has any ideas. |
Note; If I call |
It feels like OmniSharp needs to be specifying default run settings, but that feels very error prone. |
Maybe it's not so error prone. Simply passing in an empty run settings does the trick. E.g.: SendMessage(MessageType.TestRunSelectedTestCasesDefaultHost,
new
{
TestCases = testCases,
RunSettings = @"<RunSettings />"
}); @rprouse: It does indeed look like test adapters are expected to work in the face of null RunSettings. Any chance of getting that into the new release of the NUniTestAdapter? |
I'm re-opening because there's a change I can make on our side to make this work. It's not a "correct" change, but it'll be progress. |
OK. I've merged the fix in OmniSharp. Now to work on putting a new beta release together... |
@DustinCampbell you are correct that NUnit should handle null, the documentation clearly shows an example with a null value. We've just never had to deal with it before because Visual Studio always passed in a value, even if it was just I have fixed this in the NUnit adapter with nunit/nunit3-vs-adapter@d345c72 and the NuGet package |
Environment data
.NET Command Line Tools (1.0.1)
Product Information:
Version: 1.0.1
Commit SHA-1 hash: 005db40cd1
Runtime Environment:
OS Name: Windows
OS Version: 6.1.7601
OS Platform: Windows
RID: win7-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.1
VS Code version:
Version 1.11.2
Commit 6eaebe3b9c70406d67c97779468c324a7a95db0e
Date 2017-04-13T08:03:11.395Z
Shell 1.4.6
Renderer 53.0.2785.143
Node 6.5.0
C# Extension version: 1.9.0
Steps to reproduce
Unzip the file and try debug!
UnitTest.zip
Expected behavior
Debugs run!
Actual behavior
"Failed to start debugger: null" exception
The text was updated successfully, but these errors were encountered: