-
Notifications
You must be signed in to change notification settings - Fork 676
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 run test because null with nested test classes. #1151
Comments
Thanks. This looks like a dupe of #1100 |
@gregg-miskelly It is not necessarily a dupe (depending on how we define dupe), because there are multiple reasons why Omnisharp might give that error. See also: http://stackoverflow.com/q/40858172/1108891 |
Okay, I will reopen for now then. |
Yeah, this has a different error. However, the "dupe" is from several months ago, so it might just be that behavior has changed since then. I suspect we started hitting null with this change: OmniSharp/omnisharp-roslyn#683 FWIW, this will require a fix in omnisharp-roslyn. Looking at the code in https://github.com/OmniSharp/omnisharp-roslyn/blob/master/src/OmniSharp.DotNetTest/Helpers/TestFeaturesDiscover.cs, I can see how it might fail to locate tests in nested classes. I'll take a look at this shortly. |
shortly == tomorrow. 😄 |
Note: There's also #743 |
Looks like the problem is that there's some hacky code in omnisharp-roslyn that searches specifically for the presence of 'project.json'. https://github.com/OmniSharp/omnisharp-roslyn/blob/dev/src/OmniSharp.DotNetTest/Helpers/ProjectPathResolver.cs#L11 |
OK. I see why the problem is specific to tests in nested classes. The offending line of code is here: https://github.com/OmniSharp/omnisharp-roslyn/blob/dev/src/OmniSharp.DotNetTest/Helpers/TestFeaturesDiscover.cs#L41. Essentially, the code expects Roslyn's |
OK. I've got a fix for this in omnisharp-roslyn. |
Environment data
dotnet --info
output: 1.0.0-preview2-003133VS Code version: 1.9.0-insider
C# Extension version: 1.6.2
Steps to reproduce
For us the problem was nested classes. OmniSharp cannot handle this, when we click
run test
.Expected behavior
The test runs and the output says "Test Passed".
Actual behavior
The text was updated successfully, but these errors were encountered: