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

fix: a couple uncaught exceptions during coverage processing #908

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
)

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

Check warning on line 45 in services/report/languages/simplecov.py

View check run for this annotation

Codecov Notifications / codecov/patch

services/report/languages/simplecov.py#L45

Added line #L45 was not covered by tests
_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 @@
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):

Check warning on line 132 in services/report/report_processor.py

View check run for this annotation

Codecov Notifications / codecov/patch

services/report/report_processor.py#L132

Added line #L132 was not covered by tests
pass

return raw_report, "txt"
Expand Down
Loading