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

Added Branch Coverage Information in Coverage Publisher #76

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

divyajo25
Copy link

@divyajo25 divyajo25 commented Jun 13, 2024

This PR enhances the Coverage Publisher by adding branch coverage information to the generated cjson files. The Coverage Publisher now processes jacoco.xml, clover.xml, and cobertura.xml files to also include branch coverage data, which is stored as line number and the associated total branches, and covered branches to it.

Details of Changes:

FileCoverageInfo Enhancements:
Added a new dictionary to FileCoverageInfo that maps line numbers to their respective total branches and covered branches.

Report Generator Updates:
Integrated logic to retrieve branch coverage data from the branchesByLine in the code files.

Unit Test Updates:
Updated existing unit tests for FileCoverageInfo to include branch coverage status.
Added new unit tests in the ReportGeneratorToolTest to verify the branch coverage status.

After this is completed the next steps will be -
The cjson files are now equipped with branch coverage data and will be sent to storage.
Planned adjustments to the CoverageMerge job to retrieve and incorporate branch coverage information.
Changes in stored procedures and SQL tables to handle the new branch coverage data.

Output CJSON file for a cobertura.xml input

Screenshot 2024-06-13 101218

Output CJSON file for a JaCoCo.xml input

Screenshot 2024-06-13 102311

@@ -59,9 +60,23 @@ public List<FileCoverageInfo> GetFileCoverageInfos()
{
resultFileCoverageInfo.LineCoverageStatus.Add((uint)lineNumber, line == 0 ? CoverageStatus.NotCovered : CoverageStatus.Covered);
}

/// populating branch coverage status

Choose a reason for hiding this comment

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

Can we have these changes behind feature flag

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.

3 participants