[gnome-continuous-yocto/gnomeostree-3.28-rocko: 7016/8267] oeqa/core/runner: OEStreamLogger don't buffer test execution writes



commit 0f0368d0527eacb13ac8547c2732219b0d4b64fe
Author: Aníbal Limón <anibal limon linux intel com>
Date:   Wed Jul 26 10:04:10 2017 -0500

    oeqa/core/runner: OEStreamLogger don't buffer test execution writes
    
    Since OEQA framework uses Python logging functionality to report test
    results there is a class that wraps PyUnit writes into logging commands
    (OEStreamLogger), so don't buffer the actual test execution to have
    insight of what is currently executing.
    
    This fix will change a little the test output format adding an '\n'
    previous the test result, for example:
    
    From:
    
    test_nonmatching_checksum (lic_checksum.LicenseTests) ... ok
    
    To:
    
    test_nonmatching_checksum (lic_checksum.LicenseTests)
     ... ok
    
    This is because the new line added by the PyUnit StreamLogger because
    currently we don't have a manner to identify when a test execution
    starts at report level (write msg).
    
    [YOCTO #11827]
    
    (From OE-Core rev: 4c2276469f58a88f864eb374c00dbbaace702de4)
    
    Signed-off-by: Aníbal Limón <anibal limon linux intel com>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 meta/lib/oeqa/core/runner.py |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/meta/lib/oeqa/core/runner.py b/meta/lib/oeqa/core/runner.py
index 8a55c24..f6539e6 100644
--- a/meta/lib/oeqa/core/runner.py
+++ b/meta/lib/oeqa/core/runner.py
@@ -25,10 +25,14 @@ class OEStreamLogger(object):
 
     def write(self, msg):
         if len(msg) > 1 and msg[0] != '\n':
-            self.buffer += msg
-        else:
-            self.logger.log(logging.INFO, self.buffer.rstrip("\n"))
-            self.buffer = ""
+            if '...' in msg:
+                self.buffer += msg
+            elif self.buffer:
+                self.buffer += msg
+                self.logger.log(logging.INFO, self.buffer)
+                self.buffer = ""
+            else:
+                self.logger.log(logging.INFO, msg)
 
     def flush(self):
         for handler in self.logger.handlers:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]