-
Notifications
You must be signed in to change notification settings - Fork 386
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
1.5.0 instruments and reports on the unit test project in addition to the assembly under test. #372
Comments
#318 we don'ts skip test project anymore, if you don't want cover test project you can use |
with coverlet.msbuild 2.5.1 I'm seeing coverage report include info for dependencies as well. I don't know if this is because of the coverlet or dotnet test. Will have to look into it. Edit: Yes, it seems once we updated to 2.5.1 the coverage report includes information for 3rd party assemblies. To me that is not the expected default behavior. Edit: This happens with 2.5.0 as well. |
I had to add the following to get the "old" behavior. Otherwise it was trying to instrument some System.* classes.
You'd think a breaking change would be mentioned in some release notes somewhere. |
I think this is a bug. Most developers will not want this behavior. The fact that everyone has to go do this by default is wrong. |
I totally agree. I think instrumenting your unit test code is a bug as well, but I guess one guy asked for that as a "feature" and here we are. |
/cc @tonerdo we should think to add a notes doc somewhere with "behavioural changes"
@scovel @derhally read all thread of PR #318 there is an important point that drove us to accept the update, the key part is #318 (comment) How can you understand if some code is not covered due to issue with some "non run tests" and find which? |
I don't agree. I personally never want to instrument my unit tests. My unit test runner tells me which tests are run, skipped or failed. That should not be the default behavior of coverlet. I expect that most people care only about the SUT not what is testing the SUT. At this point I cannot use coverlet 2.5. or later. I'm having to exclude 5 or 6 external assemblies from one project. I work with dozens of projects and having to do this on each one and everytime I add a 3rd party nuget package is quite silly. |
The right thing to do was to have a flag that enabled this behavior change. This behavior should not be the default. |
I read all of that PR, didn't necessarily agree with it. I saw you debated adding a flag and then decided to change the default behavior instead. That's fine, but some release notes for 1.5.0 would have been good. I think derhally is referring to some system assemblies getting instrumented as being a bug. Without excluding [System*]* . I get the following:
And then get errors about that assembly later in the process. That seems to me to be a bug. |
With v 2.6.0 coverlet I see errors like this
|
|
@derhally @MarcoRossignoli That error is because Coverlet is unconditionally trying to restore the pdb file for an assembly that has it embedded. I'm also in agreement with @derhally with respect to including test assemblies by default and I'll work on putting this feature behind a flag that will be turned off by default. Will address this weekend |
thank's for info! |
With the exact same command-line, coverlet console 1.5.0 is instrumenting and reporting coverage for the unit test project itself, where in 1.4.1 it only instrumented the project under test as expected.
coverlet console 1.4.1
coverlet console 1.5.0
The text was updated successfully, but these errors were encountered: