Skip to content

Handling failures correctly and adding timeout status #1411

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

Merged
merged 1 commit into from
Nov 9, 2015
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
11 changes: 5 additions & 6 deletions workspace_tools/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,12 +1034,11 @@ def shape_global_test_loop_result(self, test_all_result, waterfall_and_consolida
"""
result = self.TEST_RESULT_FAIL

if waterfall_and_consolidate:
if any(res == self.TEST_RESULT_OK for res in test_all_result):
result = self.TEST_RESULT_OK
else:
if all(test_all_result[0] == res for res in test_all_result):
result = test_all_result[0]
if all(test_all_result[0] == res for res in test_all_result):
result = test_all_result[0]
elif waterfall_and_consolidate and any(res == self.TEST_RESULT_OK for res in test_all_result):
result = self.TEST_RESULT_OK

return result

def run_host_test(self, name, image_path, disk, port, duration,
Expand Down
4 changes: 4 additions & 0 deletions workspace_tools/upload_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,14 @@ def add_test_runs(args):
testRun['output'] = ""

errors = test_case.findall('error')
failures = test_case.findall('failure')

if errors:
testRun['pass'] = False
testRun['result'] = errors[0].attrib['message']
elif failures:
testRun['pass'] = False
testRun['result'] = failures[0].attrib['message']
else:
testRun['pass'] = True
testRun['result'] = 'OK'
Expand Down