-
Notifications
You must be signed in to change notification settings - Fork 3
fix: Redo SCoverage report parsing logic to parse external XML format #193
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
base: main
Are you sure you want to change the base?
Conversation
The current parsers use the scoverage-data/scoverage.coverage.xml file which is meant to be used internally for storing data. SCoverage has a different XML reporting format for external consumption. Newer versions of the library default to txt files for internal data. SonarQube and other similar tools rely on the external format. The new implementation adds capability to parse the external format from XML attributes and computes partial lines based on the executed statements. Also adds new test case which is inline with the external format. Changes are not breaking, the previous format is also supported.
The current parsers use the scoverage-data/scoverage.coverage.xml file which is meant to be used internally for storing data. SCoverage has a different XML reporting format for external consumption. Newer versions of the library default to txt files for internal data. SonarQube and other similar tools rely on the external format. The new implementation adds capability to parse the external format from XML attributes and computes partial lines based on the executed statements. Also adds new test case which is inline with the external format. Changes are not breaking, the previous format is also supported.
The current parsers use the scoverage-data/scoverage.coverage.xml file which is meant to be used internally for storing data. SCoverage has a different XML reporting format for external consumption. Newer versions of the library default to txt files for internal data. SonarQube and other similar tools rely on the external format. The new implementation adds capability to parse the external format from XML attributes and computes partial lines based on the executed statements. Also adds new test case which is inline with the external format. Changes are not breaking, the previous format is also supported.
The current parsers use the scoverage-data/scoverage.coverage.xml file which is meant to be used internally for storing data. SCoverage has a different XML reporting format for external consumption. Newer versions of the library default to txt files for internal data. SonarQube and other similar tools rely on the external format. The new implementation adds capability to parse the external format from XML attributes and computes partial lines based on the executed statements. Also adds new test case which is inline with the external format. Changes are not breaking, the previous format is also supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for the PR! it appears our CI is not working for community contributions (i might have broken it with a recent change) but we can get that sorted
left a few comments. i think i (or someone) will need to ramp up a bit on the format you're supporting here because there are some things i don't understand from a quick glance:
- what the
start
andend
attributes on eachstatement
mean - why
line="5"
appears several times, some havingbranch="true"
and others havingbranch="false"
- why something having partial coverage is not tied to the
branch
attribute - why a fully-covered branch should be recorded as a line instead of a branch
does /src/main/scala/CoverageClass.scala
have, like, 500-character lines with several totally distinct statements and control flow blocks on them?
if you could explain that'd help, else i'll try to get back to you early next week!
# We only mark it as a branch if it's a partial coverage | ||
coverage_type = CoverageType.branch if is_partial else CoverageType.line | ||
_file.append(line, report_builder_session.create_coverage_line(cov, coverage_type)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would we want to do this?
# Add the line | ||
ln = int(child_text(statement, "line")) | ||
hits = child_text(statement, "count") | ||
is_partial = len(included_statements) > 1 and len(covered_statements) < len(included_statements) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't is_partial
factor in whether the branch
attribute is true?
#199 i think this PR should fix the CI issue |
The current parsers use the scoverage-data/scoverage.coverage.xml file which is meant to be used internally for storing data. SCoverage has a different XML reporting format for external consumption. Newer versions of the library default to txt files for internal data instead of xml. SonarQube and other similar tools rely on the external format. The new implementation adds capability to parse the external format from XML attributes and computes partial lines based on the executed statements. Also adds new test case which is inline with the external format.
Changes are not breaking, the previous format is also supported.
Reference Links: