Merged
Conversation
Instead of calling Coverlet directly via MSBuild property, the dotnet CLI integration is used. This was done to check if the code coverage reports are maybe merged OOTB.
Switch to using `dotnet test` with Coverlet MSBuild properties for generating JSON and Cobertura coverage formats. Adjusted output paths for proper merging of coverage results.
Updated the build pipeline to generate and merge test coverage reports in OpenCover format. Introduced `dotnet-reportgenerator` for merging coverage reports of different target framework runs and point SonarQube to merged coverage report location.
HaGGi13
added a commit
that referenced
this pull request
Feb 22, 2026
Fix SonarQube code coverage detection The code coverage reports were necessary to name with the `CoverletOutput` parameter, otherwise files were generated starting with `TestResults` whereby this is should be the directory and not part of the code coverage report file name. In addition, the SonarQube prepare step was updated to point SonarQube to the correct coverage report files. Because this library is targets multiple frameworks, each of its test runs creates a dedicated code coverage report file, hence a wildcard (asterisk) was necessary to used to tell SonarQube to fetch all of those files and merge them by itself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix SonarQube code coverage detection
The code coverage reports were necessary to name with the
CoverletOutputparameter, otherwise files were generated starting withTestResultswhereby this is should be the directory and not part ofthe code coverage report file name.
In addition, the SonarQube prepare step was updated to point SonarQube
to the correct coverage report files. Because this library is targets
multiple frameworks, each of its test runs creates a dedicated code
coverage report file, hence a wildcard (asterisk) was necessary to used
to tell SonarQube to fetch all of those files and merge them by itself.