]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/runner: Sort the test result output by result class
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 13 Nov 2018 21:11:50 +0000 (21:11 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 6 Dec 2018 13:50:07 +0000 (13:50 +0000)
We want to see failures/errors listed last since this is the most easily
visible part of the log on consoles or autobuilder output and makes
human processing easier rather than having to scroll up and scan for
a single failure.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/core/runner.py

index 0cb1a95c1ee30b1508aafb63657106d506388c7d..f8bb23f344c697fbd7f1097327c4758a7e14a628 100644 (file)
@@ -107,6 +107,7 @@ class OETestResult(_TestResult):
         self.tc.logger.info("RESULTS:")
 
         result = {}
+        logs = {}
         if hasattr(self.tc, "extraresults"):
             result = self.tc.extraresults
 
@@ -121,8 +122,19 @@ class OETestResult(_TestResult):
                     if hasattr(d, 'oeid'):
                         oeid = d.oeid
 
-            self.tc.logger.info("RESULTS - %s - Testcase %s: %s" % (case.id(), oeid, status))
-            result[case.id()] = {'status': status, 'log': log}
+            if status not in logs:
+                logs[status] = []
+            logs[status].append("RESULTS - %s - Testcase %s: %s" % (case.id(), oeid, status))
+            if log:
+                result[case.id()] = {'status': status, 'log': log}
+            else:
+                result[case.id()] = {'status': status}
+
+        for i in ['PASSED', 'SKIPPED', 'EXPECTEDFAIL', 'ERROR', 'FAILED', 'UNKNOWN']:
+            if i not in logs:
+                continue
+            for l in logs[i]:
+                self.tc.logger.info(l)
 
         if json_file_dir:
             tresultjsonhelper = OETestResultJSONHelper()