Zero coverage collection specifically during a CI build
See original GitHub issueI’ve been updating my project, CSharpMinifier, to bring it up to date with the .NET 6 SDK as well as its dependencies. As part of that, I’ve been also fixing the code coverage collection by using the data collector instead of the MSBuild integration (which was misreporting coverage with NaN
percentages).
Everything is working locally, as can be seen by the following text summary generated by ReportGenerator:
Summary
Generated on: 13/11/2021 - 14:42:18
Parser: MultiReportParser (15x CoberturaParser)
Assemblies: 1
Classes: 14
Files: 11
Line coverage: 96.9%
Covered lines: 1065
Uncovered lines: 33
Coverable lines: 1098
Total lines: 2209
CSharpMinifier 96.9%
CSharpMinifier.CSharpString 99.3%
CSharpMinifier.Internals.JsonString 96.4%
CSharpMinifier.MinificationOptions 96.0%
CSharpMinifier.Minifier 98.8%
CSharpMinifier.Position 82.3%
CSharpMinifier.Region 75.0%
CSharpMinifier.Scanner 99.7%
CSharpMinifier.StringExtensions 100.0%
CSharpMinifier.StringValueParseResult 59.3%
CSharpMinifier.SubstringPool 100.0%
CSharpMinifier.SyntaxErrorException 33.3%
CSharpMinifier.Token 33.3%
CSharpMinifier.TokenExtensions 100.0%
CSharpMinifier.TokenKindExtensions 100.0%
However, on CI builds (using AppVeyor), I am getting zero coverage:
Summary
Generated on: 11/13/2021 - 1:39:02 PM
Parser: MultiReportParser (6x CoberturaParser)
Assemblies: 0
Classes: 0
Files: 0
Line coverage:
Covered lines: 0
Uncovered lines: 0
Coverable lines: 0
Total lines: 0
No assemblies have been covered.
I have Codecov setup to report on uploaded coverage data and it’s showing a blank. When I check the coverage XML files uploaded to Codecov, they are indeed empty.
I have also added diagnostics logging and uploaded the files as artifacts but cannot find anything unusual or an error in them.
I have scanned the issues in this repo and went over the troubleshooting page to try and solve the problem on my own, but now opening this issue having reached a roadblock. Hope it’s not some stupid mistake on my part. Let me know how I can help with more data and input to troubleshoot this issue.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top GitHub Comments
So disabling incremental cleaning did the trick for me! Coverage is not being reported during a CI build too! 🎉
@daveMueller Thanks again for sharing your findings, which provided some clues and eventually helped me to find the real culprit and solution!
Hey @daveMueller, just thought I’d share some some of my findings so far in case it can help in the future even though it’s not related to coverlet. It seems that incremental cleaning is the culprit here. I found the following in the build logs for second runs:
I think I might be running into dotnet/msbuild#1054 although I still haven’t found a solution based on what I’ve read in the issue’s thread.