Skip to content
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

Publisher makes 2 HTML reports on azure with PublishCodeCoverageResults@2. This makes it slow with large coverage data. #72

Open
pavelliavonau opened this issue Jan 12, 2024 · 1 comment

Comments

@pavelliavonau
Copy link

pavelliavonau commented Jan 12, 2024

I found that coverage publisher has unexpected behaviour in my case. My log at azuredevops PublishCodeCoverageResults@2 is following:

...
Found 1 result(s) matching pattern: F:\agent1\_work\2\TestResults\*\*.cobertura.xml
F:\agent1\_work\2\TestResults\3e4306b4-f889-4e26-91b6-ccef258d7ca8\unittest.mytest.cobertura.xml
...
##[debug]ReportGeneratorTool.ParseCoverageFiles: Parsing coverage files.
...
2024-01-12T18:27:17: Finished parsing 'F:\agent1\_work\2\TestResults\3e4306b4-f889-4e26-91b6-ccef258d7ca8\unittest.mytest.cobertura.xml' 1/1
2024-01-12T18:27:17: Parsing of 1 files completed
2024-01-12T18:27:17: Starting merging result 1
2024-01-12T18:27:17: Finished merging result 1
##[debug]ReportGeneratorTool.CreateHTMLReportFromParserResult: Creating HTML report.
2024-01-12T18:27:18: Initializing report builders for report types: HtmlInline_AzurePipelines
2024-01-12T18:27:18: Analyzing 249 classes
...
##[debug]Parser.GenerateHTMLReport: Creating summary file directory: F:\agent1\_work\_temp\ff13e3f5-e245-48a5-ab0c-07e0e60a6528\Summary_ec27501f
##[debug]Parser.GenerateHTMLReport: Copying summary file F:\agent1\_work\2\TestResults\3e4306b4-f889-4e26-91b6-ccef258d7ca8\unittest.mytest.cobertura.xml
##[debug]PERF : Parser.ReportGeneration : took 7079.4571 ms.
##[debug]ReportGeneratorTool.GetFileCoverageInfos: Generating file coverage info from coverage files.
##[debug]ReportGeneratorTool.CreateHTMLReportFromParserResult: Creating HTML report.
2024-01-12T18:27:24: Initializing report builders for report types: HtmlInline_AzurePipelines
2024-01-12T18:27:24: Analyzing 249 classes
...
2024-01-12T18:27:28: Creating summary
2024-01-12T18:27:28: Writing report file 'F:\agent1\_work\_temp\ff13e3f5-e245-48a5-ab0c-07e0e60a6528\index.html'
##[debug]Parser.GenerateHTMLReport: Creating summary file directory: F:\agent1\_work\_temp\ff13e3f5-e245-48a5-ab0c-07e0e60a6528\Summary_fb1344ea
##[debug]Parser.GenerateHTMLReport: Copying summary file F:\agent1\_work\2\TestResults\3e4306b4-f889-4e26-91b6-ccef258d7ca8\unittest.mytest.cobertura.xml
##[debug]PERF : Parser.ReportGeneration : took 4310.1144 ms.
##[debug]ReportGeneratorTool.GetCoverageSummary: Generating coverage summary for the coverage files.
##[debug]Publishing code coverage summary supported
Publishing coverage summary data.
...

As a result I have 2 summary folders published with the same coverage files.

I guess the first call of GenerateHTMLReport is redundant and should not be called.

Version:

Task         : Publish code coverage results v2
Description  : Publish any of the code coverage results from a build
Version      : 2.231.0

@mdkieferbp
Copy link

I have noticed this same issue. With more than 1400 files, it REALLY slows things down a lot. At first I thought it was because it was detecting 2 identical .cobertura.xml files in different folders, but even when I fixed that using the code below the duplicate file generate still occurred:

      - task: PublishCodeCoverageResults@2
        displayName: 'Publish code coverage results'
        inputs:
          # don't use "CoverageResults\**\*cobertura.xml" as it will find duplicate files in the output tree and thus take twice as long to publish.
          summaryFileLocation: '$(Build.SourcesDirectory)\CoverageResults\*\*cobertura.xml'
          failIfCoverageEmpty: 'false'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants