diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2019-04-24 21:08:37 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2019-12-22 21:04:41 +0100 |
commit | 07f409672cf9b22f0229b35ca988c942bf50cd32 (patch) | |
tree | eade723385acdc2da109c4a7558d9daf090d1dc0 /xtesting/ci/run_tests.py | |
parent | 489813b07b1a5b418e32ebaec2b9a13f93e848aa (diff) |
Enable debug messages via env var
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 <cedric.ollivier@orange.com>
Diffstat (limited to 'xtesting/ci/run_tests.py')
-rw-r--r-- | xtesting/ci/run_tests.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xtesting/ci/run_tests.py b/xtesting/ci/run_tests.py index eb1fc6da..0f43210c 100644 --- a/xtesting/ci/run_tests.py +++ b/xtesting/ci/run_tests.py @@ -314,8 +314,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:]) |