Re: [OE-core] [PATCH 2/7] oeqa/runqemu: Only show stdout/stderr upon test failure

2017-11-09 Thread Richard Purdie
On Thu, 2017-11-09 at 14:04 +0100, Patrick Ohly wrote:
> On Thu, 2017-11-09 at 11:55 +, Richard Purdie wrote:
> > 
> > +    # We only want to print runqemu stdout/stderr if there is a
> > test
> > case failure
> > +    buffer = True
> Does the value matter? The other code only seems to check for the
> presence of the "buffer" attribute.

True, I think I should tweak that other code so it passes on the
value...

Cheers,

Richard
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 2/7] oeqa/runqemu: Only show stdout/stderr upon test failure

2017-11-09 Thread Patrick Ohly
On Thu, 2017-11-09 at 11:55 +, Richard Purdie wrote:
> +    # We only want to print runqemu stdout/stderr if there is a test
> case failure
> +    buffer = True

Does the value matter? The other code only seems to check for the
presence of the "buffer" attribute.

Changing this to "buffer = False" and still get buffering would be
surprising.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 2/7] oeqa/runqemu: Only show stdout/stderr upon test failure

2017-11-09 Thread Richard Purdie
In general we don't need to see the output of runqemu however if it fails
we do. Use the buffer option that already exists in TestResult but allow
us to trigger it on a per test basis.

Signed-off-by: Richard Purdie 
---
 meta/lib/oeqa/core/runner.py| 8 
 meta/lib/oeqa/selftest/cases/runqemu.py | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/meta/lib/oeqa/core/runner.py b/meta/lib/oeqa/core/runner.py
index f6539e6..2d756da 100644
--- a/meta/lib/oeqa/core/runner.py
+++ b/meta/lib/oeqa/core/runner.py
@@ -45,6 +45,14 @@ class OETestResult(_TestResult):
 self.tc = tc
 self._tc_map_results()
 
+def startTest(self, test):
+# Allow us to trigger the testcase buffer mode on a per test basis
+# so stdout/stderr are only printed upon failure. Enables debugging
+# but clean output
+if hasattr(test, "buffer"):
+self.buffer = True
+super(OETestResult, self).startTest(test)
+
 def _tc_map_results(self):
 self.tc._results['failures'] = self.failures
 self.tc._results['errors'] = self.errors
diff --git a/meta/lib/oeqa/selftest/cases/runqemu.py 
b/meta/lib/oeqa/selftest/cases/runqemu.py
index 1991be7..1a8d121 100644
--- a/meta/lib/oeqa/selftest/cases/runqemu.py
+++ b/meta/lib/oeqa/selftest/cases/runqemu.py
@@ -14,6 +14,8 @@ class RunqemuTests(OESelftestTestCase):
 
 image_is_ready = False
 deploy_dir_image = ''
+# We only want to print runqemu stdout/stderr if there is a test case 
failure
+buffer = True
 
 def setUpLocal(self):
 super(RunqemuTests, self).setUpLocal()
-- 
2.7.4

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core