Include doesn't seem to work
See original GitHub issueUsing the NuGet integration (haven’t tried the global tool), I want to be able to include only the coverage from the project I’m unit testing.
I have multiple projects and multiple test projects:
- StackState.Core
- StackState.Core.UnitTests
- StackState.CLI
- StackState.Monitor
- StackState.Monitor.UnitTests
When I generate coverage for the “StackState.Monitor.UnitTests” project, without specifying any include or exclude filters, the result is this:
+---------------------------+--------+--------+--------+ | Module | Line | Branch | Method | +---------------------------+--------+--------+--------+ | StackState.Core | 0,4% | 0% | 0,7% | +---------------------------+--------+--------+--------+ | StackState.Core.UnitTests | 4,4% | 0% | 6,8% | +---------------------------+--------+--------+--------+ | StackState.Monitor | 37,6% | 21,7% | 56,5% | +---------------------------+--------+--------+--------+
When I add “/p:Exclude=”[StackState.Core*]*“”, the result is:
+--------------------+--------+--------+--------+ | Module | Line | Branch | Method | +--------------------+--------+--------+--------+ | StackState.Monitor | 37,6% | 21,7% | 56,5% | +--------------------+--------+--------+--------+
The above is actually what I want, but I want to get this result by INcluding the one project that 1 want coverage for and not EXcluding everything else. Besides that it’s cumbersome, it’s also currently not possible to do from a PowerShell window: https://github.com/tonerdo/coverlet/issues/182. Anyway, changing the parameter to “/p:Include=”[StackState.Monitor*]*“” results again in:
+---------------------------+--------+--------+--------+ | Module | Line | Branch | Method | +---------------------------+--------+--------+--------+ | StackState.Core | 0,4% | 0% | 0,7% | +---------------------------+--------+--------+--------+ | StackState.Core.UnitTests | 4,4% | 0% | 6,8% | +---------------------------+--------+--------+--------+ | StackState.Monitor | 37,6% | 21,7% | 56,5% | +---------------------------+--------+--------+--------+
Either I’m doing something wrong, or the include setting doesn’t seem to work.
So why is this an issue at all? I’m trying to get Coverage Gutters working together with Coverlet, but when Code Gutters finds multiple coverage files with overlapping values it seems to pick the last one and not combine the data. As combining coverage results isn’t possible yet with Coverlet as well, this seems to be my only way out.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11
Top GitHub Comments
this bug is solved I did a test with last version 2.7.0 and this is my result of repro.
I’m going to close…feel free to reopen if needed.
I’m having the same problem: /p:Include is not working.