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 handling of test failures/errors #451

Merged
Merged
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: 3 additions & 3 deletions server/autotest_server/testers/java/java_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,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
Loading