-
Notifications
You must be signed in to change notification settings - Fork 23
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
Two copies of code coverage files are being created. #161
Comments
Thanks for reporting.
Was this actually blocking in some way? What led you to discover this in the first place? Was the added time actually significant in your build?
I'd prefer to not even generate the duplicates in the first place. @MarcoRossignoli any ideas? |
Originally, the mergecoverage step timed out in my build (over 30 minutes). My investigation led me to discover the recent changes to the library template I picked up were the root cause. I first noticed the duplicate coverage files. Unfortunately, removing the duplicate code coverage files didn't fixed the performance of my build as the mergecoverage step is still taking 15 minutes vs 30 seconds previously. I excluded some external packages (e.g. Moq) from my coverage results so it's just my project but that didn't help. Across all of my agent and platform builds, I have 24 code coverage files, totaling roughly 70 MB worth of coverage data. Currently, I'm debugging whether the substitution or call to report generator is the source of the delay by adding a Write-Host.
|
Wow. How large were your code coverage files before this change? |
I think it's related to the by design behavior of trx logger with datacollectors inside CI(previous will be using coverlet msbuild integration, ignored by AzDo) microsoft/vstest#2334 (comment) For the performance issue is it possible that now reports are bigger because they're containing more instrumented libraries? Coverlet was using a different heuristics to exclude files to instrument. |
The proposed fix only works with there is one level of test projects (e.g $RepoRoot/test/MyTestProject/TestResults. I have subfolders of test projects so I need to use -Recurse. The following code worked for me. It excludes any "In" folder on Windows and non-Windows which has the duplicate code coverage file. The report generation takes 3 seconds. The path fixups is what is taking so long.
|
I'm working on the change now. Thank you so much for the feedback, @SteveBush and the proposed fix. I hope you'll take a look at the PR when it comes out. |
Are you talking about the new regex replacements in publish-codecoverage.yml? I wonder how cutting the file count by half drops time from minutes to just 3 seconds. |
Two copies of a code coverage file are being created with the most recent changes. This is causing the report generator tool do double the work to dedupe the code coverage data.
Proposed fix in coverageResults.ps1 to remove duplicates from /In/ folder:
$coverageFiles = @(Get-ChildItem "$RepoRoot/test/*.cobertura.xml" -Recurse | Where {$_.FullName -notlike "*/In/*" -and $_.FullName -notlike "*\In\*" })
There may be a more elegant way to do this but this unblocked me.
The text was updated successfully, but these errors were encountered: