-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
NullReferenceException only dotcover test coverage runner #171
Comments
Further investigation seems to show that, when running in normal debug unit test mode, I can put a breakpoint on However, when running with the Really struggling to understand what the dotCover tool could be doing different when running the code which make it run differently. Can expressions differ based on runtime or configuration? |
Can you provide a test case which is failing? |
My suspicion is that dotcover changes IL which is not recognized by decompiler |
Managed to get some further information out by adding a call to else if (state.Instruction.OpCode == OpCodes.Stfld)
{
var value = state.Stack.Pop();
var instance = state.Stack.Pop();
var field = (FieldInfo) state.Instruction.Operand;
Debug.WriteLine("!!! RUNNING LINE 268 FOR INSTRUCTION {0}", state.Instruction);
var expression = BuildAssignment(instance.Expression, field, value, out var push);
if (push)
state.Stack.Push(expression);
else
instance.Expression = expression;
} Running dotCover outputs the following which I think may explain the issue I'm seeing.
The code I'm currently running this on I am unable to share but if I cannot resolve the issue then I will try to reproduce it with a small POC code example tomorrow. |
Wonder if there is a way to detect running within dotcover and exclude certain dotcover statements from being processed? |
Should be fixed in 0.29.0 |
@hazzik I'm afraid to say that it is not quite fixed 😞I'm seeing a different error based on the changes in 0.29.0 as follows
|
I've created #172 to track it. |
… match Fixes hazzik#171 +semver:bug
I am currently faced with a very confusing issue. I have some unit tests which utilise an implementation of
IAsyncEnumerable
andIAsyncQueryProvider
to enable testing ofEntityFrameworkCore
async extensions. I've implemented DelegateDecompiler and am seeing weird issues where some of my unit tests are failing only when running code coverage withdotnet dotcover test
(https://www.jetbrains.com/help/dotcover/Running_Coverage_Analysis_from_the_Command_LIne.html#using-dotnet-exe-to-run-coverage-analysis-of-unit-tests)I have tried running the tests normally with just
dotnet test
and with the built in unit test and coverage tools within JetBrains Rider IDE, and the test run successfully onAny ideas very welcome! Thanks.
The text was updated successfully, but these errors were encountered: