Commit 7a9a079f authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis Committed by Christos Stavrakakis
Browse files

snf-burnin: Change exit code to 1 for errors

When burnin test cases fail, return 1 as exit code.
parent 83cd9dff
......@@ -1661,7 +1661,7 @@ class TestRunnerProcess(Process):
fail.write(str(res[0].shortDescription()) + '\n')
fail.write('\n')
if not NOFAILFAST:
sys.exit()
sys.exit(1)
if (len(result.failures) == 0) and (len(result.errors) == 0):
log.debug("Passed testcase: %s" % msg)
......@@ -1677,6 +1677,8 @@ class TestRunnerProcess(Process):
def _run_cases_in_series(cases, image_folder):
"""Run instances of TestCase in series"""
error_found = False
for case in cases:
test = case.__name__
......@@ -1709,6 +1711,7 @@ def _run_cases_in_series(cases, image_folder):
error.write(str(res[0]) + '\n')
error.write(str(res[0].shortDescription()) + '\n')
error.write('\n')
error_found = True
for res in result.failures:
log.error("snf-burnin failed in testcase: %s" % test)
......@@ -1716,12 +1719,19 @@ def _run_cases_in_series(cases, image_folder):
fail.write(str(res[0]) + '\n')
fail.write(str(res[0].shortDescription()) + '\n')
fail.write('\n')
error_found = True
if not NOFAILFAST:
sys.exit()
sys.exit(1)
if (len(result.failures) == 0) and (len(result.errors) == 0):
log.debug("Passed testcase: %s" % test)
# Return
if error_found:
return 1
else:
return 0
def _run_cases_in_parallel(cases, fanout, image_folder):
"""Run instances of TestCase in parallel, in a number of distinct processes
......
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