diff options
author | Konrad Weihmann <kweihmann@outlook.com> | 2020-11-10 20:20:16 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2020-11-11 04:35:09 -1000 |
commit | aca4b863c2878b31c3cb506b05d1e19ef525e4af (patch) | |
tree | f582e2577e3765dcf33c072d1ab4d75fd1f7cf07 | |
parent | 4ebf97e36d9def38fb869cbbbd5ce10f5d2669a3 (diff) | |
download | openembedded-core-aca4b863c2878b31c3cb506b05d1e19ef525e4af.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
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>
-rw-r--r-- | meta/classes/testimage.bbclass | 19 |
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): package_extraction(d, tc.suites) results = None + complete = False orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception) try: # We need to check if runqemu ends unexpectedly @@ -375,6 +376,7 @@ def testimage_main(d): except ValueError: pass results = tc.runTests() + complete = True except (KeyboardInterrupt, BlockingIOError) as err: if isinstance(err, KeyboardInterrupt): bb.error('testimage interrupted, shutting down...') @@ -382,20 +384,21 @@ def testimage_main(d): bb.error('runqemu failed, shutting down...') if results: results.stop() - results = None + results = tc.results finally: signal.signal(signal.SIGTERM, orig_sigterm_handler) tc.target.stop() # 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) - 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(): bb.fatal('%s - FAILED - check the task log and the ssh log' % pn, forcelog=True) |