]> code.ossystems Code Review - openembedded-core.git/commitdiff
oe-build-perf-test: suppress logger output when tests are being run
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Wed, 29 Jun 2016 17:11:28 +0000 (20:11 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 17 Aug 2016 09:35:24 +0000 (10:35 +0100)
Prevent logger from writing to stderr when the tests are being run by
the TestRunner. During this time the logger output is only written to
the log file. This way the console output from the script is cleaner and
not mixed with possible logger records.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/oe-build-perf-test

index 786c715dfc65be70b345f4a71edfbed91e093f50..4e6d7383748da36638b03da4cfc016befcb9f2c6 100755 (executable)
@@ -133,10 +133,19 @@ def main(argv=None):
     out_dir = args.out_dir.format(date=datetime.now().strftime('%Y%m%d%H%M%S'))
     setup_file_logging(os.path.join(out_dir, 'output.log'))
 
-    # Run actual tests
     archive_build_conf(out_dir)
     runner = BuildPerfTestRunner(out_dir, verbosity=2)
+
+    # Suppress logger output to stderr so that the output from unittest
+    # is not mixed with occasional logger output
+    log.handlers[0].setLevel(logging.CRITICAL)
+
+    # Run actual tests
     result = runner.run(suite)
+
+    # Restore logger output to stderr
+    log.handlers[0].setLevel(log.level)
+
     if result.wasSuccessful():
         if args.globalres_file:
             result.update_globalres_file(args.globalres_file)