mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 00:39:46 +00:00
oeqa/runner: Ensure class setup errors are shown to bitbake logging
This took a bit of digging but failure messages from testimage are shown to bitbake's logging through stopTest. In the case of a setUpClass failure stopTest is never called and the bitbake logging never sees the error. It would still be in the task logfile. Add some code+comment to ensure logs not shown to the user mid stream are shown at the end. (From OE-Core rev: 7342c418bda2cc3c337a190089864ea731ff62e4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -44,6 +44,7 @@ class OETestResult(_TestResult):
|
|||||||
self.endtime = {}
|
self.endtime = {}
|
||||||
self.progressinfo = {}
|
self.progressinfo = {}
|
||||||
self.extraresults = {}
|
self.extraresults = {}
|
||||||
|
self.shownmsg = []
|
||||||
|
|
||||||
# Inject into tc so that TestDepends decorator can see results
|
# Inject into tc so that TestDepends decorator can see results
|
||||||
tc.results = self
|
tc.results = self
|
||||||
@@ -74,6 +75,7 @@ class OETestResult(_TestResult):
|
|||||||
for (scase, msg) in getattr(self, t):
|
for (scase, msg) in getattr(self, t):
|
||||||
if test.id() == scase.id():
|
if test.id() == scase.id():
|
||||||
self.tc.logger.info(str(msg))
|
self.tc.logger.info(str(msg))
|
||||||
|
self.shownmsg.append(test.id())
|
||||||
break
|
break
|
||||||
|
|
||||||
def logSummary(self, component, context_msg=''):
|
def logSummary(self, component, context_msg=''):
|
||||||
@@ -169,7 +171,6 @@ class OETestResult(_TestResult):
|
|||||||
|
|
||||||
def logDetails(self, json_file_dir=None, configuration=None, result_id=None,
|
def logDetails(self, json_file_dir=None, configuration=None, result_id=None,
|
||||||
dump_streams=False):
|
dump_streams=False):
|
||||||
self.tc.logger.info("RESULTS:")
|
|
||||||
|
|
||||||
result = self.extraresults
|
result = self.extraresults
|
||||||
logs = {}
|
logs = {}
|
||||||
@@ -193,6 +194,10 @@ class OETestResult(_TestResult):
|
|||||||
report = {'status': status}
|
report = {'status': status}
|
||||||
if log:
|
if log:
|
||||||
report['log'] = log
|
report['log'] = log
|
||||||
|
# Class setup failures wouldn't enter stopTest so would never display
|
||||||
|
if case.id() not in self.shownmsg:
|
||||||
|
self.tc.logger.info("Failure (%s) for %s:\n" % (status, case.id()) + log)
|
||||||
|
|
||||||
if duration:
|
if duration:
|
||||||
report['duration'] = duration
|
report['duration'] = duration
|
||||||
|
|
||||||
@@ -215,6 +220,7 @@ class OETestResult(_TestResult):
|
|||||||
report['stderr'] = stderr
|
report['stderr'] = stderr
|
||||||
result[case.id()] = report
|
result[case.id()] = report
|
||||||
|
|
||||||
|
self.tc.logger.info("RESULTS:")
|
||||||
for i in ['PASSED', 'SKIPPED', 'EXPECTEDFAIL', 'ERROR', 'FAILED', 'UNKNOWN']:
|
for i in ['PASSED', 'SKIPPED', 'EXPECTEDFAIL', 'ERROR', 'FAILED', 'UNKNOWN']:
|
||||||
if i not in logs:
|
if i not in logs:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user