-
Notifications
You must be signed in to change notification settings - Fork 513
Switch to coverlet.collector for code coverage #4070
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
Draft
sharwell
wants to merge
12
commits into
DotNetAnalyzers:master
Choose a base branch
from
sharwell:coverlet
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
Why - Prepare migration to coverlet while keeping OpenCover available. What - Added coverlet.console 6.0.4 entry to .nuget/packages.config. - Restored packages so coverlet console binaries are present locally. Notes - Kept OpenCover entry to avoid breaking existing scripts mid-migration. Testing - .\.nuget\nuget.exe install .\.nuget\packages.config -OutputDirectory packages
Why - Move CI coverage off OpenCover to maintained coverlet tooling. - Keep artifact structure unchanged for downstream merge/upload steps. What - Run coverlet.console via dotnet around xunit to gather coverage. - Keep xUnit XML output; store Cobertura in build/OpenCover.Reports. Notes - Kept legacy folder name so downstream merge/upload stays intact. Testing - Not run (CI pipeline change only).
Why - Prepare test projects for coverlet collector-based dotnet test runs. - Keep coverage filters aligned with existing OpenCover configuration. What - Added coverlet.collector and Microsoft.NET.Test.Sdk to all test csproj. - Added a shared coverlet.runsettings with include/exclude settings. Notes - OpenCover/coverlet.console tooling remains for now during migration. Testing - Not run (package and coverage configuration updates only).
Why - Align CI test runs with coverlet.collector and dotnet test. - Keep coverage artifacts flowing while switching away from OpenCover tooling. What - Run dotnet test per language/TFM with coverlet collector and runsettings. - Emit TRX results to a known directory and publish Cobertura copies from build/coverage. Notes - Coverage files retain the OpenCover.* naming to keep downstream merge steps working until they are updated. Testing - Not run (CI pipeline change only).
Why - Align the coverage merge with the new collector-produced artifact layout. - Keep the existing ReportGenerator + Codecov flow intact. What - Point ReportGenerator glob at coverageResults-*/coverage/OpenCover.*.xml. Notes - Final Cobertura.xml path stays unchanged for CodecovUploader. Testing - Not run (CI pipeline change only).
Why - Provide a local coverage workflow aligned with coverlet.collector instead of OpenCover. - Keep existing entrypoint usable while shifting tooling underneath. What - Added coverage-report.ps1 to run dotnet test with coverlet collector and generate Cobertura + HTML. - Forwarded opencover-report.ps1 to the new script with a deprecation warning. Notes - Script preserves prior flags (Debug/NoBuild/NoReport) for compatibility. - Coverage files keep the OpenCover.* naming to match existing merge expectations. Testing - Not run (local script changes only).
Why - Provide contributors a way to inspect coverage for their changed files before pushing. - Keep the collector-based local coverage workflow consistent with CI. What - Added DiffBase/DiffOnly support to coverage-report.ps1 using git diff file filters. - Generate filtered HTML and text summaries via ReportGenerator for changed files. Notes - Defaults to origin/master when DiffOnly is used without an explicit base. - Falls back with warnings if git or diffs are unavailable. Testing - Not run (script changes only).
Why - Explain how to run local coverage with the new collector-based scripts. - Help contributors focus on coverage for changed code before pushing. What - Documented full and diff-only coverage commands, outputs, and CI alignment. Notes - Scripts rely on init/build having run; failures bubble as non-zero exit codes. Testing - Not run (documentation change only).
Why - OpenCover tooling is no longer used now that coverlet.collector drives coverage. What - Removed OpenCover entry from .nuget/packages.config. Notes - coverlet.console remains during migration; can be dropped once unused. Testing - .\.nuget\nuget.exe install .\.nuget\packages.config -OutputDirectory packages
Why - Coverage now runs via coverlet.collector, so the console tool is no longer needed. What - Removed coverlet.console from .nuget/packages.config and cleaned its local package folder. Notes - OpenCover tooling was already removed; remaining coverage dependencies are ReportGenerator and CodecovUploader. Testing - Not run (dependency cleanup only).
Why - Ensure test assemblies are covered alongside product code. - Improve coverage collection performance for local and CI runs. What - Updated coverlet runsettings to include test assemblies and use single-hit mode. Notes - Existing include/exclude filters remain unchanged. Testing - Not run (configuration-only change).
Why - Prevent local coverage outputs from cluttering git status. What - Added coverage directories (build/coverage, build/TestResults, etc.) to .gitignore. Notes - Existing ignore rules remain unchanged. Testing - Not run (ignore rule change only).
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.
No description provided.