Catch xml.etree.ElementTree ParseError exception from an invalid XML file #153
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context:
If the test results file contains a broken XML content, the junitparser command will fail with a:
xml.etree.ElementTree.ParseError: syntax error: ..
failure.See job failure example: https://prow.ci.openshift.org/view/gs/test-platform-results/logs/periodic-ci-mtc-qe-mtc-e2e-qev2-master-mtc1.8-ocp4.15-lp-interop-mtc-interop-aws/1756921885850865664#1:build-log.txt%3A93
This happens especially when we modify the test results with replacing it's content with a string contains:
"This file contained potentially sensitive information and has been removed.\\n"
REF:
https://redhat-internal.slack.com/archives/C04PK4QPSR1/p1707747454327419