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

Generating Html only for Native Coverage #87

Merged

Conversation

vinayakmsft
Copy link
Collaborator

@vinayakmsft vinayakmsft commented Jan 21, 2025

PR description- Earlier we were lopping through all the input coverage files and calling the PublishHTMLReport(config.ReportDirectory, token) method for each of the valid native coverage file (.xml/.locv/.gcov) etc. This causes issue as it will generate a Report Directory for every file which is not required. Instead, we can improve this by just having an initial check condition that will check if all the inputs files are valid and does not contain the files like (.coverage/.cjson/covx/covb) and then call the PublishHtmlReport method only once for those input files thus generating 1 Report Directory. This change will improve the overall time of the PCCRV2 task and also would avoid unnecessary generating of the Report Directory for files.

With this change the performance of the PCCRV2 task improves. The code coverage data remains the same and no changes are impacted on those lines.

Testing :

  1. When we use the native coverage files (.xmls/.lcov/.gcov)

image

  1. When files like .coverage/.cjson are passed to PCCRV2- We should not generate the html for those files. We should just upload those files and display the desired data in the desired format (.coverage/cjson)

image

Risk assessment:

Low

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

src/CoveragePublisher/CoverageProcessor.cs:96

  • [nitpick] The method name IsContainsNativeCoverage is awkward. It should be renamed to ContainsNativeCoverage.
if(IsContainsNativeCoverage(config))

src/CoveragePublisher/CoverageProcessor.cs:129

  • There is an extra space in the comment. It should be .covb instead of .covb .
coverageFile.EndsWith(Constants.CoverageConstants.CoverageBFileExtension) ||        //.covb 
@vinayakmsft vinayakmsft merged commit 54dff14 into master Jan 21, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants