1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 17:19:20 +00:00

testimage: print results for interrupted runs

When a run is ended by overall timeout, print the already executed
testcases, to provide some hints which testcase might made the
test suite reach global timeout.
Nonetheless make the testrun exit with an error

(From OE-Core rev: 2bcc643195a3b3c66d698fac8b7af037c08545ac)

Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Konrad Weihmann
2020-11-10 20:20:16 +01:00
committed by Richard Purdie
parent 3c4147880e
commit e8fd6bb2ec
+11 -8
View File
@@ -367,6 +367,7 @@ def testimage_main(d):
package_extraction(d, tc.suites) package_extraction(d, tc.suites)
results = None results = None
complete = False
orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception) orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception)
try: try:
# We need to check if runqemu ends unexpectedly # We need to check if runqemu ends unexpectedly
@@ -378,6 +379,7 @@ def testimage_main(d):
except ValueError: except ValueError:
pass pass
results = tc.runTests() results = tc.runTests()
complete = True
except (KeyboardInterrupt, BlockingIOError) as err: except (KeyboardInterrupt, BlockingIOError) as err:
if isinstance(err, KeyboardInterrupt): if isinstance(err, KeyboardInterrupt):
bb.error('testimage interrupted, shutting down...') bb.error('testimage interrupted, shutting down...')
@@ -385,20 +387,21 @@ def testimage_main(d):
bb.error('runqemu failed, shutting down...') bb.error('runqemu failed, shutting down...')
if results: if results:
results.stop() results.stop()
results = None results = tc.results
finally: finally:
signal.signal(signal.SIGTERM, orig_sigterm_handler) signal.signal(signal.SIGTERM, orig_sigterm_handler)
tc.target.stop() tc.target.stop()
# Show results (if we have them) # Show results (if we have them)
if not results: if results:
configuration = get_testimage_configuration(d, 'runtime', machine)
results.logDetails(get_testimage_json_result_dir(d),
configuration,
get_testimage_result_id(configuration),
dump_streams=d.getVar('TESTREPORT_FULLLOGS'))
results.logSummary(pn)
if not results or not complete:
bb.fatal('%s - FAILED - tests were interrupted during execution' % pn, forcelog=True) bb.fatal('%s - FAILED - tests were interrupted during execution' % pn, forcelog=True)
configuration = get_testimage_configuration(d, 'runtime', machine)
results.logDetails(get_testimage_json_result_dir(d),
configuration,
get_testimage_result_id(configuration),
dump_streams=d.getVar('TESTREPORT_FULLLOGS'))
results.logSummary(pn)
if not results.wasSuccessful(): if not results.wasSuccessful():
bb.fatal('%s - FAILED - check the task log and the ssh log' % pn, forcelog=True) bb.fatal('%s - FAILED - check the task log and the ssh log' % pn, forcelog=True)