Repository navigation
Fix code coverage collection on net481 - #44
Merged
Merged
Conversation
coverlet.collector 8.0.0 dropped its netstandard2.0 build assets and ships net8.0 or later only. A net481 test project cannot consume those, so NuGet resolved the package with no build assets at all, coverlet.collector.dll never reached the test output, and the "XPlat Code Coverage" data collector did not exist: Data collection : Unable to find a datacollector with friendly name 'XPlat Code Coverage'. Nothing failed the build over it. NuGet does not warn when build assets are incompatible, and codecov-action has disable_search off, so after not finding artifacts/logs/*/coverage.cobertura.xml it searched, found one unrelated file, and uploaded that instead of erroring. Hold the package at 6.0.4, the last release a .NET Framework test project can use, and record the constraint at the reference so a future bump does not quietly break coverage again.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #44 +/- ##
============================================
+ Coverage 0 80.42% +80.42%
============================================
Files 0 10 +10
Lines 0 235 +235
Branches 0 67 +67
============================================
+ Hits 0 189 +189
- Misses 0 23 +23
- Partials 0 23 +23 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Code coverage has not been collected in this repository since
coverlet.collectormoved past 6.x. Same defect and same fix as autofac/Autofac.Multitenant.Wcf#12.Proposed Changes
coverlet.collectorto[6.0.4], the last release shippingnetstandard2.0build assets. Every release from 8.0.0 on shipsnet8.0and later only, which anet481test project cannot consume, so NuGet resolved the package with no build assets at all —coverlet.collector.dllnever reached the test output and theXPlat Code Coveragedata collector did not exist.Notes
Two things kept this quiet. NuGet does not warn when a package's build assets are framework-incompatible. And the shared
ci.ymlleavesdisable_searchoff, so codecov loggednot_found_filesforartifacts/logs/*/coverage.cobertura.xml, searched, found one unrelated file, and uploaded that instead of failing — despitefail_ci_if_error: true. Settingdisable_search: trueinautofac/.githubwould turn that into a hard failure across every repo; that is not part of this PR.Verified locally: restore resolves
buildassets fornet481, the test run producesartifacts/logs/*/coverage.cobertura.xml, and 61 passed / 11 skipped is unchanged (the skips are the Windows-only hosting tests).