Skip to content

Commit

Permalink
fix: a couple uncaught exceptions during coverage processing (#908)
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-codecov authored Nov 21, 2024
1 parent ab219bc commit ff51806
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions services/report/languages/simplecov.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ def from_json(json: dict, report_builder_session: ReportBuilderSession) -> None:
)

for ln, cov in enumerate(coverage_to_check, start=1):
if cov == "ignored":
# Lines that simplecov skipped are recorded as "ignored" by
# https://github.com/codeclimate-community/simplecov_json_formatter
# and we in turn record that as -1 which indicates a skipped line
# in our report
cov = -1
_file.append(
ln,
report_builder_session.create_coverage_line(
Expand Down
2 changes: 1 addition & 1 deletion services/report/report_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def report_type_matching(
processed = etree.fromstring(raw_report, parser=parser)
if processed is not None and len(processed) > 0:
return processed, "xml"
except ValueError:
except (ValueError, etree.XMLSyntaxError):
pass

return raw_report, "txt"
Expand Down

0 comments on commit ff51806

Please sign in to comment.