Commit 916e1d00 authored by Julien Muchembled's avatar Julien Muchembled

erp5_test_result: workaround for NEO test results

parent d6d7b72d
test_result = sci['object'] test_result = sci['object']
kw = sci['kwargs'] kw = sci['kwargs']
test_result.setStopDate(kw.get('date') or DateTime()) test_result.setStopDate(kw.get('date') or DateTime())
def unexpected(test_result):
# We must change to only distinguish SKIP/EXPECTED/UNEXPECTED, instead of
# SKIP/FAIL/ERROR. NEO reports EXPECTED as FAIL and we want to mark it as
# passed if there's no unexpected failures.
return test_result.getSourceProjectTitle() != "NEO R&D"
if test_result.getPortalType() == 'Test Result': if test_result.getPortalType() == 'Test Result':
has_unknown_result = False has_unknown_result = False
edit_kw = dict(duration=0, edit_kw = dict(duration=0,
...@@ -15,8 +22,11 @@ if test_result.getPortalType() == 'Test Result': ...@@ -15,8 +22,11 @@ if test_result.getPortalType() == 'Test Result':
except TypeError as e: except TypeError as e:
context.log("", repr(e)) context.log("", repr(e))
has_unknown_result = True has_unknown_result = True
has_unknown_result = has_unknown_result or line.getStringIndex() == 'UNKNOWN' else:
if has_unknown_result or edit_kw['errors'] or edit_kw['failures']: if line.getStringIndex() == 'UNKNOWN':
has_unknown_result = True
if has_unknown_result or edit_kw['errors'] or (
edit_kw['failures'] and unexpected(test_result)):
status = 'FAIL' status = 'FAIL'
else: else:
status = 'PASS' status = 'PASS'
...@@ -30,7 +40,7 @@ elif test_result.getPortalType() == 'Test Result Line': ...@@ -30,7 +40,7 @@ elif test_result.getPortalType() == 'Test Result Line':
if all_tests is None: if all_tests is None:
status = 'UNKNOWN' status = 'UNKNOWN'
all_tests = 0 all_tests = 0
elif errors or failures: elif errors or failures and unexpected(test_result.getParentValue()):
status = 'FAILED' status = 'FAILED'
else: else:
status = 'PASSED' status = 'PASSED'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment