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

[Feature Request] Calculating total coverage for whole solution #1569

Open
tlorenz9 opened this issue Dec 12, 2023 · 1 comment
Open

[Feature Request] Calculating total coverage for whole solution #1569

tlorenz9 opened this issue Dec 12, 2023 · 1 comment
Labels
as-designed Expected behaviour question This issue is a question

Comments

@tlorenz9
Copy link

I have a solution with multiple projects and test projects which are contributing to the total coverage of the solution. Coverlet seems to check the coverage thresholds for every single test project, even when used with the MergeWith option.

My request would be to add an option to only check the last total coverage, because this will be the relevant one for the whole solution.

dotnet test --configuration Release /p:CollectCoverage=true /p:CoverletOutputFormat=\"json,opencover\" /p:ThresholdStat=total /p:Threshold=80 /p:CoverletOutput=../CoverageResults/ /p:MergeWith="../CoverageResults/coverage.json" /p:Exclude=\"someExclusions\" -m:1

So if we could have a "whole total" option for thresholdStat, this would be great. Or am I missing something?

@github-actions github-actions bot added the untriaged To be investigated label Dec 12, 2023
@Bertk Bertk added question This issue is a question and removed untriaged To be investigated labels Jan 13, 2024
@Bertk
Copy link
Collaborator

Bertk commented Jan 13, 2024

Hi, we use reportgenerator which merges coverage files and also allows to filter classes, assemblies and source files. This tool also allows to define thresholds as well e.g. --minimumCoverageThresholds:lineCoverage=${{parameters.minimumLineCoverage}}

see also coverlet CI:

ReportGenerator minimumCoverageThresholds settings

Note (dotnet test)

NET 7.0.200 SDK and later

If you specify the --output option when running this command on a solution, the CLI will emit a warning (an error in 7.0.200) due to the unclear semantics of the output path. The --output option is disallowed because all outputs of all built projects would be copied into the specified directory, which isn't compatible with multi-targeted projects, as well as projects that have different versions of direct and transitive dependencies. For more information, see Solution-level --output option no longer valid for build-related commands.

@Bertk Bertk added the as-designed Expected behaviour label Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
as-designed Expected behaviour question This issue is a question
Projects
None yet
Development

No branches or pull requests

2 participants