From f5d73689bdd4e9dbff98c04e190023b7f66ed7c9 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Wed, 24 Apr 2019 21:08:37 +0200 Subject: Enable debug messages via env var MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It stops printing in xtesting.debug.log by default. It decreases testing duration via Raspberry PI without additional tasks [1]. [1] https://wiki.opnfv.org/display/functest/Run+Functest+containers+on+Raspberry+PI Change-Id: I2eded47a7a150a45330a69f3262fc7ca6fdb7463 Signed-off-by: Cédric Ollivier --- xtesting/ci/run_tests.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'xtesting/ci/run_tests.py') diff --git a/xtesting/ci/run_tests.py b/xtesting/ci/run_tests.py index c8e99663..94bf2787 100644 --- a/xtesting/ci/run_tests.py +++ b/xtesting/ci/run_tests.py @@ -307,8 +307,12 @@ def main(): if ex.errno != errno.EEXIST: six.print_("Cannot create /var/lib/xtesting/results/") return testcase.TestCase.EX_RUN_ERROR - logging.config.fileConfig(pkg_resources.resource_filename( - 'xtesting', 'ci/logging.ini')) + if env.get('DEBUG').lower() == 'true': + logging.config.fileConfig(pkg_resources.resource_filename( + 'xtesting', 'ci/logging.debug.ini')) + else: + logging.config.fileConfig(pkg_resources.resource_filename( + 'xtesting', 'ci/logging.ini')) logging.captureWarnings(True) parser = RunTestsParser() args = parser.parse_args(sys.argv[1:]) -- cgit 1.2.3-korg