Skip to content
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

JetBrains dotCover fails to gather coverage of tests with aspects Kind.Around #150

Closed
sergeprozorov opened this issue Mar 30, 2021 · 4 comments
Assignees
Labels

Comments

@sergeprozorov
Copy link

Hello,

The issue might be related to #107, but the error message I see is different. Additionally, I provide a reliable way to reproduce it.
The scenario is following

Run the unit tests from AspectInjector.SampleApps with code coverage. You can see that code coverage report is empty.
image

If you run a test session without CacheTests with code coverage, you will see some results there.
image

In order to see the error message itself being produced by dotCover, I have used the approach described here, because it is the simplest for me. The message is following.

[JetBrains dotCover] Coverage session finished with errors: Jump to invalid address
[location] = C:\BuildAgent\work\82554ce5cfd8f0cd\Profiler\Kernel\Windows\Native\Solution\core\src\IL\InjectILMethod.MainPass.cpp(388)
[function] = unsigned int __cdecl InjectILMethod::Translate(unsigned int,bool)
[token] = 06000012, MethodDef
[method name] = CalculateTask
[module name] = C:\work\temp\aspect-injector\samples\tests\Aspests.Tests\bin\Debug\netcoreapp2.1\Aspests.Tests.dll
[type name] = Aspests.Tests.CacheTests+TestClass.

Additionally, I would like to mention that it is not only dotCover that fails to collect code coverage. One of my colleagues has also tried OpenCover with a similar result. It is pity but this issue is a blocker for us currently, as it breaks our CI workflow.

@pamidur
Copy link
Owner

pamidur commented Mar 30, 2021

ok, it seems that the dotCover modifies the assembly to gather the coverage results, which make sense.
The problem it seems that dotCover conflicts with AspectInjector somehow.

Thanks for reliable way get it

@pamidur
Copy link
Owner

pamidur commented Mar 30, 2021

@sergeprozorov
Copy link
Author

@pamidur Yes, the issue appears to be fixed. I have checked it on a couple of projects (on AspectInjector.SampleApps too). Code coverage works now in the both VS UI and dotCover CLI.
Thank you, great work!

@pamidur
Copy link
Owner

pamidur commented Mar 31, 2021

this 2.5.1-pre1 should be stable despite it is pre-release, So I guess you might safely use it until full release is out. Possible issues are only with debug process:

  • breakpoints fire in wrong places
  • watch/locals doesn't show (some) local scope variables

I have experienced none of above tho.
Please report if find any bugs))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants