summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/runcmd.py
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2017-06-27 13:03:40 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-28 20:55:08 +0100
commitea34f20a06e3c5f2912fca0e71e29b17a1d9df59 (patch)
treec53811ffcd8fd9941f05027a51a0e2f0f7494fcc /meta/lib/oeqa/selftest/cases/runcmd.py
parenta17cf42a1240ff1c520632da853e6a7ef68389f6 (diff)
downloadpoky-ea34f20a06e3c5f2912fca0e71e29b17a1d9df59.tar.gz
commands.py: live output logging + result.error encoding fix
Tests that use bitbake("my-test-image") can run for a long time without any indication to the user of oe-selftest about what's going on. The test author has to log the bitbake output explicitly, otherwise it is lost in case of test failures. Now it is possible to use bitbake("my-test-image", output_log=self.logger) to get more output both on the console and in the XML output (when xmlrunner is installed). Example output: 2017-06-23 12:23:14,144 - oe-selftest - INFO - Running tests... 2017-06-23 12:23:14,145 - oe-selftest - INFO - ---------------------------------------------------------------------- 2017-06-23 12:23:14,151 - oe-selftest - INFO - Running: bitbake my-test-image 2017-06-23 12:23:16,363 - oe-selftest - INFO - Loading cache...done. 2017-06-23 12:23:17,575 - oe-selftest - INFO - Loaded 3529 entries from dependency cache. 2017-06-23 12:23:18,811 - oe-selftest - INFO - Parsing recipes...done. 2017-06-23 12:23:19,659 - oe-selftest - INFO - Parsing of 2617 .bb files complete (2612 cached, 5 parsed). 3533 targets, 460 skipped, 0 masked, 0 errors. 2017-06-23 12:23:19,659 - oe-selftest - INFO - NOTE: Resolving any missing task queue dependencies Because the implementation was already using threading, the same is done to decouple reading and writing the different pipes instead of trying to multiplex IO in a single thread. Previously the helper thread waited for command completion, now that is done in the main thread. The most common case (no input data, joined stdout/stderr) still uses one extra thread and a single read(), so performance should be roughly the same as before. Probably unintentionally, result.error was left as byte string when migrating to Python3. OE-core doesn't seem to use runCmd() with split output at the moment, so changing result.error to be treated the same as result.output (i.e. decoded to a normal strings) seems like a relatively safe API change (or rather, implementation fix). (From OE-Core rev: 00b8c7ff17cd8f1920728fdc2653068e63d71724) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> merge: wait() Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/runcmd.py')
0 files changed, 0 insertions, 0 deletions