summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2017-07-26 10:04:10 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-30 08:46:19 +0100
commit0f0368d0527eacb13ac8547c2732219b0d4b64fe (patch)
treecaada67596d791de47d93c29a572959318807d88 /meta
parent2d50f153b5b76adbd4157d2f69001ed91e9148dc (diff)
downloadpoky-0f0368d0527eacb13ac8547c2732219b0d4b64fe.tar.gz
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>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/core/runner.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/meta/lib/oeqa/core/runner.py b/meta/lib/oeqa/core/runner.py
index 8a55c24c78..f6539e60b6 100644
--- a/meta/lib/oeqa/core/runner.py
+++ b/meta/lib/oeqa/core/runner.py
@@ -25,10 +25,14 @@ class OEStreamLogger(object):
25 25
26 def write(self, msg): 26 def write(self, msg):
27 if len(msg) > 1 and msg[0] != '\n': 27 if len(msg) > 1 and msg[0] != '\n':
28 self.buffer += msg 28 if '...' in msg:
29 else: 29 self.buffer += msg
30 self.logger.log(logging.INFO, self.buffer.rstrip("\n")) 30 elif self.buffer:
31 self.buffer = "" 31 self.buffer += msg
32 self.logger.log(logging.INFO, self.buffer)
33 self.buffer = ""
34 else:
35 self.logger.log(logging.INFO, msg)
32 36
33 def flush(self): 37 def flush(self):
34 for handler in self.logger.handlers: 38 for handler in self.logger.handlers: