Skip to content

Commit

Permalink
Java tester: Fix handling of test failures/errors (MarkUsProject#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-yz-liu authored and Donny Wong committed Sep 22, 2023
1 parent f7d28b4 commit 3b89752
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/autotest_server/testers/java/java_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ def _parse_failure_error(self, failure, error):
an error and failure are present, the message includes information for both.
"""
result = {}
if failure and error:
if failure is not None and error is not None:
failure_message = self._parse_failure_error(failure, None)["message"]
error_message = self._parse_failure_error(None, error)["message"]
result["status"] = "error"
result["message"] = "\n\n".join([error_message, failure_message])
elif failure:
elif failure is not None:
result["status"] = "failure"
result["message"] = f'{failure.attrib.get("type", "")}: {failure.attrib.get("message", "")}'
elif error:
elif error is not None:
result["status"] = "error"
result["message"] = f'{error.attrib.get("type", "")}: {error.attrib.get("message", "")}'
return result
Expand Down

0 comments on commit 3b89752

Please sign in to comment.