Commit 61dd90e0 authored by Jérome Perrin's avatar Jérome Perrin

test_result: don't set status "PASS" when build fail

When installing the tested software failed, no test result lines
have been created, this should have status FAILED.
parent ad92e7fb
Pipeline #14660 failed with stage
...@@ -739,6 +739,7 @@ class TestTaskDistribution(TaskDistributionTestCase): ...@@ -739,6 +739,7 @@ class TestTaskDistribution(TaskDistributionTestCase):
self.tool.reportTaskFailure(test_result_path, {}, "UnitTestNode 1") self.tool.reportTaskFailure(test_result_path, {}, "UnitTestNode 1")
self.assertEqual("failed", test_result.getSimulationState()) self.assertEqual("failed", test_result.getSimulationState())
checkNodeState("failed", "failed") checkNodeState("failed", "failed")
self.assertEqual("FAIL", test_result.getStringIndex())
def test_07b_reportTaskFailureWithRunningTest(self): def test_07b_reportTaskFailureWithRunningTest(self):
""" """
......
...@@ -41,7 +41,8 @@ if test_result.getPortalType() == 'Test Result': ...@@ -41,7 +41,8 @@ if test_result.getPortalType() == 'Test Result':
failures=0, failures=0,
skips=0, skips=0,
test_result_retry_count=0) test_result_retry_count=0)
for line in test_result.objectValues(portal_type='Test Result Line'): test_result_line_list = test_result.objectValues(portal_type='Test Result Line')
for line in test_result_line_list:
for prop in edit_kw: for prop in edit_kw:
try: try:
edit_kw[prop] = edit_kw[prop] + line.getProperty(prop, 0) edit_kw[prop] = edit_kw[prop] + line.getProperty(prop, 0)
...@@ -51,7 +52,7 @@ if test_result.getPortalType() == 'Test Result': ...@@ -51,7 +52,7 @@ if test_result.getPortalType() == 'Test Result':
else: else:
if line.getStringIndex() == 'UNKNOWN': if line.getStringIndex() == 'UNKNOWN':
has_unknown_result = True has_unknown_result = True
if has_unknown_result or edit_kw['errors'] or ( if has_unknown_result or not test_result_line_list or edit_kw['errors'] or (
edit_kw['failures'] and unexpected(test_result)): edit_kw['failures'] and unexpected(test_result)):
status = 'FAIL' status = 'FAIL'
else: else:
......
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