summaryrefslogtreecommitdiffstats
path: root/meta/classes/testimage.bbclass
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-11 10:08:12 +0000
commite8fd6bb2ecc8c43d338572011e67e9016922697c (patch)
treeecfd700e732e45b626c198a6d1f8dfba10af8b30 /meta/classes/testimage.bbclass
parent3c4147880e501335b4be098478d0c94db49a6042 (diff)
downloadpoky-e8fd6bb2ecc8c43d338572011e67e9016922697c.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: 2bcc643195a3b3c66d698fac8b7af037c08545ac) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/testimage.bbclass')
-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 e3feef02f8..78da4b09bd 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -367,6 +367,7 @@ def testimage_main(d):
367 package_extraction(d, tc.suites) 367 package_extraction(d, tc.suites)
368 368
369 results = None 369 results = None
370 complete = False
370 orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception) 371 orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception)
371 try: 372 try:
372 # We need to check if runqemu ends unexpectedly 373 # We need to check if runqemu ends unexpectedly
@@ -378,6 +379,7 @@ def testimage_main(d):
378 except ValueError: 379 except ValueError:
379 pass 380 pass
380 results = tc.runTests() 381 results = tc.runTests()
382 complete = True
381 except (KeyboardInterrupt, BlockingIOError) as err: 383 except (KeyboardInterrupt, BlockingIOError) as err:
382 if isinstance(err, KeyboardInterrupt): 384 if isinstance(err, KeyboardInterrupt):
383 bb.error('testimage interrupted, shutting down...') 385 bb.error('testimage interrupted, shutting down...')
@@ -385,20 +387,21 @@ def testimage_main(d):
385 bb.error('runqemu failed, shutting down...') 387 bb.error('runqemu failed, shutting down...')
386 if results: 388 if results:
387 results.stop() 389 results.stop()
388 results = None 390 results = tc.results
389 finally: 391 finally:
390 signal.signal(signal.SIGTERM, orig_sigterm_handler) 392 signal.signal(signal.SIGTERM, orig_sigterm_handler)
391 tc.target.stop() 393 tc.target.stop()
392 394
393 # Show results (if we have them) 395 # Show results (if we have them)
394 if not results: 396 if results:
397 configuration = get_testimage_configuration(d, 'runtime', machine)
398 results.logDetails(get_testimage_json_result_dir(d),
399 configuration,
400 get_testimage_result_id(configuration),
401 dump_streams=d.getVar('TESTREPORT_FULLLOGS'))
402 results.logSummary(pn)
403 if not results or not complete:
395 bb.fatal('%s - FAILED - tests were interrupted during execution' % pn, forcelog=True) 404 bb.fatal('%s - FAILED - tests were interrupted during execution' % pn, forcelog=True)
396 configuration = get_testimage_configuration(d, 'runtime', machine)
397 results.logDetails(get_testimage_json_result_dir(d),
398 configuration,
399 get_testimage_result_id(configuration),
400 dump_streams=d.getVar('TESTREPORT_FULLLOGS'))
401 results.logSummary(pn)
402 if not results.wasSuccessful(): 405 if not results.wasSuccessful():
403 bb.fatal('%s - FAILED - check the task log and the ssh log' % pn, forcelog=True) 406 bb.fatal('%s - FAILED - check the task log and the ssh log' % pn, forcelog=True)
404 407