summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Weihmann <kweihmann@outlook.com>2020-11-10 20:20:16 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-11-20 10:44:34 +0000
commit8148892fee15751e54bcdde0c2972748cd980d76 (patch)
tree93ce6af99049eac31cc7f76b9e87948d13feac0f
parent199d43ac1e0e2ae0497ae005098be6815b3b18a9 (diff)
downloadpoky-8148892fee15751e54bcdde0c2972748cd980d76.tar.gz
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: aca4b863c2878b31c3cb506b05d1e19ef525e4af) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2bcc643195a3b3c66d698fac8b7af037c08545ac) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/testimage.bbclass19
1 files changed, 11 insertions, 8 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 00f0c29836..c709384b91 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -364,6 +364,7 @@ def testimage_main(d):
364 package_extraction(d, tc.suites) 364 package_extraction(d, tc.suites)
365 365
366 results = None 366 results = None
367 complete = False
367 orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception) 368 orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception)
368 try: 369 try:
369 # We need to check if runqemu ends unexpectedly 370 # We need to check if runqemu ends unexpectedly
@@ -375,6 +376,7 @@ def testimage_main(d):
375 except ValueError: 376 except ValueError:
376 pass 377 pass
377 results = tc.runTests() 378 results = tc.runTests()
379 complete = True
378 except (KeyboardInterrupt, BlockingIOError) as err: 380 except (KeyboardInterrupt, BlockingIOError) as err:
379 if isinstance(err, KeyboardInterrupt): 381 if isinstance(err, KeyboardInterrupt):
380 bb.error('testimage interrupted, shutting down...') 382 bb.error('testimage interrupted, shutting down...')
@@ -382,20 +384,21 @@ def testimage_main(d):
382 bb.error('runqemu failed, shutting down...') 384 bb.error('runqemu failed, shutting down...')
383 if results: 385 if results:
384 results.stop() 386 results.stop()
385 results = None 387 results = tc.results
386 finally: 388 finally:
387 signal.signal(signal.SIGTERM, orig_sigterm_handler) 389 signal.signal(signal.SIGTERM, orig_sigterm_handler)
388 tc.target.stop() 390 tc.target.stop()
389 391
390 # Show results (if we have them) 392 # Show results (if we have them)
391 if not results: 393 if results:
394 configuration = get_testimage_configuration(d, 'runtime', machine)
395 results.logDetails(get_testimage_json_result_dir(d),
396 configuration,
397 get_testimage_result_id(configuration),
398 dump_streams=d.getVar('TESTREPORT_FULLLOGS'))
399 results.logSummary(pn)
400 if not results or not complete:
392 bb.fatal('%s - FAILED - tests were interrupted during execution' % pn, forcelog=True) 401 bb.fatal('%s - FAILED - tests were interrupted during execution' % pn, forcelog=True)
393 configuration = get_testimage_configuration(d, 'runtime', machine)
394 results.logDetails(get_testimage_json_result_dir(d),
395 configuration,
396 get_testimage_result_id(configuration),
397 dump_streams=d.getVar('TESTREPORT_FULLLOGS'))
398 results.logSummary(pn)
399 if not results.wasSuccessful(): 402 if not results.wasSuccessful():
400 bb.fatal('%s - FAILED - check the task log and the ssh log' % pn, forcelog=True) 403 bb.fatal('%s - FAILED - check the task log and the ssh log' % pn, forcelog=True)
401 404