diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-09-22 15:34:18 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-09-26 10:25:42 +0100 |
| commit | 8a69a411c039192f81ec0ca3b57fbaeeab4f3714 (patch) | |
| tree | b5a787cd2cc389829c894b894fd45f495f21e004 | |
| parent | 374fd90865bb35f6a9e48266e132966571fc6861 (diff) | |
| download | poky-8a69a411c039192f81ec0ca3b57fbaeeab4f3714.tar.gz | |
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>
| -rw-r--r-- | meta/lib/oeqa/core/runner.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/lib/oeqa/core/runner.py b/meta/lib/oeqa/core/runner.py index 5077eb8e3e..a86a706bd9 100644 --- a/meta/lib/oeqa/core/runner.py +++ b/meta/lib/oeqa/core/runner.py | |||
| @@ -44,6 +44,7 @@ class OETestResult(_TestResult): | |||
| 44 | self.endtime = {} | 44 | self.endtime = {} |
| 45 | self.progressinfo = {} | 45 | self.progressinfo = {} |
| 46 | self.extraresults = {} | 46 | self.extraresults = {} |
| 47 | self.shownmsg = [] | ||
| 47 | 48 | ||
| 48 | # Inject into tc so that TestDepends decorator can see results | 49 | # Inject into tc so that TestDepends decorator can see results |
| 49 | tc.results = self | 50 | tc.results = self |
| @@ -74,6 +75,7 @@ class OETestResult(_TestResult): | |||
| 74 | for (scase, msg) in getattr(self, t): | 75 | for (scase, msg) in getattr(self, t): |
| 75 | if test.id() == scase.id(): | 76 | if test.id() == scase.id(): |
| 76 | self.tc.logger.info(str(msg)) | 77 | self.tc.logger.info(str(msg)) |
| 78 | self.shownmsg.append(test.id()) | ||
| 77 | break | 79 | break |
| 78 | 80 | ||
| 79 | def logSummary(self, component, context_msg=''): | 81 | def logSummary(self, component, context_msg=''): |
| @@ -169,7 +171,6 @@ class OETestResult(_TestResult): | |||
| 169 | 171 | ||
| 170 | def logDetails(self, json_file_dir=None, configuration=None, result_id=None, | 172 | def logDetails(self, json_file_dir=None, configuration=None, result_id=None, |
| 171 | dump_streams=False): | 173 | dump_streams=False): |
| 172 | self.tc.logger.info("RESULTS:") | ||
| 173 | 174 | ||
| 174 | result = self.extraresults | 175 | result = self.extraresults |
| 175 | logs = {} | 176 | logs = {} |
| @@ -193,6 +194,10 @@ class OETestResult(_TestResult): | |||
| 193 | report = {'status': status} | 194 | report = {'status': status} |
| 194 | if log: | 195 | if log: |
| 195 | report['log'] = log | 196 | report['log'] = log |
| 197 | # Class setup failures wouldn't enter stopTest so would never display | ||
| 198 | if case.id() not in self.shownmsg: | ||
| 199 | self.tc.logger.info("Failure (%s) for %s:\n" % (status, case.id()) + log) | ||
| 200 | |||
| 196 | if duration: | 201 | if duration: |
| 197 | report['duration'] = duration | 202 | report['duration'] = duration |
| 198 | 203 | ||
| @@ -215,6 +220,7 @@ class OETestResult(_TestResult): | |||
| 215 | report['stderr'] = stderr | 220 | report['stderr'] = stderr |
| 216 | result[case.id()] = report | 221 | result[case.id()] = report |
| 217 | 222 | ||
| 223 | self.tc.logger.info("RESULTS:") | ||
| 218 | for i in ['PASSED', 'SKIPPED', 'EXPECTEDFAIL', 'ERROR', 'FAILED', 'UNKNOWN']: | 224 | for i in ['PASSED', 'SKIPPED', 'EXPECTEDFAIL', 'ERROR', 'FAILED', 'UNKNOWN']: |
| 219 | if i not in logs: | 225 | if i not in logs: |
| 220 | continue | 226 | continue |
