Repository navigation
ci: collect coverage with coverlet's in-proc collector - #289
Merged
Merged
Conversation
The test step passed coverage.runsettings to dotnet test but not --collect "XPlat Code Coverage". vstest only adds coverlet's in-proc collector for the collect option, so no hits were written when the test session ended. Each module wrote its hits from a ProcessExit handler instead, and vstest kills a test host that has not exited 100 ms after the run. A module whose handler had not run by then was reported with 0 hits. With both options the in-proc collector writes every module's hits at session end, and the runsettings still supply the filters. The same defect was fixed in ZeroAlloc-Net/ZeroAlloc.Outbox#426 and MarcelRoozekrans/BlazorNative#627.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
The test step ran
dotnet test --settings coverage.runsettingswithout--collect "XPlat Code Coverage", so whole modules could read 0 coverage at random.vstest adds coverlet's in-proc collector only when the collect option is given. Without it, nothing writes the hits when the test session ends. Each instrumented module writes them from a ProcessExit handler, and vstest kills a test host that has not exited 100 ms after the run. A module whose handler has not run by then is reported with 0 hits. The same defect was fixed in ZeroAlloc-Net/ZeroAlloc.Outbox#426 and MarcelRoozekrans/BlazorNative#627.
Changes
ci.yml: the Test step passes--collect "XPlat Code Coverage"before--settings coverage.runsettings. The runsettings still supply the filters.coverage.runsettings: the header comment names both options and why.Test Plan