From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 2/7] oeqa/runqemu: Only show stdout/stderr upon test failure
Date: Thu, 9 Nov 2017 11:55:46 +0000 [thread overview]
Message-ID: <1510228551-11516-2-git-send-email-richard.purdie@linuxfoundation.org> (raw)
In-Reply-To: <1510228551-11516-1-git-send-email-richard.purdie@linuxfoundation.org>
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 <richard.purdie@linuxfoundation.org>
---
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
next prev parent reply other threads:[~2017-11-09 11:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 11:55 [PATCH 1/7] qemurunner: Ensure logging handler is removed Richard Purdie
2017-11-09 11:55 ` Richard Purdie [this message]
2017-11-09 13:04 ` [PATCH 2/7] oeqa/runqemu: Only show stdout/stderr upon test failure Patrick Ohly
2017-11-09 13:23 ` Richard Purdie
2017-11-09 11:55 ` [PATCH 3/7] oeqa/targetcontrol: Drop unused get_target_controller function Richard Purdie
2017-11-09 11:55 ` [PATCH 4/7] oeqa/qemurunner: Use logger.debug, not logger.info Richard Purdie
2017-11-09 11:55 ` [PATCH 5/7] testimage: Pass the logger into OERuntimeTestContextExecutor.getTarget() Richard Purdie
2017-11-09 11:55 ` [PATCH 6/7] oeqa: Clean up logger handling Richard Purdie
2017-11-09 11:55 ` [PATCH 7/7] oeqa/target/ssh: Drop command/output logging to debug level Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1510228551-11516-2-git-send-email-richard.purdie@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox