Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] oetest: make console output more verbose
@ 2016-04-18 12:27 Ed Bartosh
  0 siblings, 0 replies; only message in thread
From: Ed Bartosh @ 2016-04-18 12:27 UTC (permalink / raw)
  To: openembedded-core

Added output of test runner to bitbake console output.
bitbake <image> -c testimage now reports test progress
to the console:
NOTE: Executing RunQueue Tasks
...
NOTE: recipe core-image-lsb-1.0-r0: task do_testimage: Started
core-image-lsb-1.0-r0 do_testimage: test_ping (oeqa.runtime.ping.PingTest) ... ok
core-image-lsb-1.0-r0 do_testimage: test_ssh (oeqa.runtime.ssh.SshTest) ... ok
...
----------------------------------------------------------------------
core-image-lsb-1.0-r0 do_testimage: Ran 38 tests in 785.100s
core-image-lsb-1.0-r0 do_testimage:
core-image-lsb-1.0-r0 do_testimage: OK (skipped=1)

Adding more output to the console should also prevent autobuilder to kill
long running tests as ab assumes that test is stuck if no console output
produced by it for a long time.

[YOCTO #8238]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 meta/lib/oeqa/oetest.py | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index 8eb84ed..3ed5bb8 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -7,7 +7,7 @@
 
 # It also has some helper functions and it's responsible for actually starting the tests
 
-import os, re, mmap
+import os, re, mmap, sys
 import unittest
 import inspect
 import subprocess
@@ -326,12 +326,8 @@ class TestContext(object):
             logger.info("Filter test cases by tags: %s" % self.tagexp)
         logger.info("Found %s tests" % self.suite.countTestCases())
         runner = unittest.TextTestRunner(verbosity=2)
-        try:
-            if bb.msg.loggerDefaultVerbose:
-                runner.stream.write = custom_verbose
-        except NameError:
-            # Not in bb environment?
-            pass
+        if 'bb' in sys.modules:
+            runner.stream.write = custom_verbose
 
         return runner.run(self.suite)
 
-- 
2.1.4



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-18 14:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-18 12:27 [PATCH] oetest: make console output more verbose Ed Bartosh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox