From 70f90bff893e842f503f005779749cdaa32bbf6c Mon Sep 17 00:00:00 2001 From: Hsin-Yi Chen Date: Thu, 21 May 2020 11:32:09 +0800 Subject: Write VNDK test logs to stdout The logs are written to stderr by default and interleave the test results that TradeFed parses. This commit configures the logger to write to stdout. Test: LD_LIBRARY_PATH=out/host/linux-x86/lib64 atest vts_vndk_files_test Bug: 156715331 Change-Id: I5dd5754e6282bcf4b1fd748bb443c079dd668b35 Merged-In: I5dd5754e6282bcf4b1fd748bb443c079dd668b35 (cherry picked from commit 49ac4ba4dfe241fba9eed937cd0558fd8defb1c2) --- abi/vts_vndk_abi_test.py | 4 ++++ dependency/vts_vndk_dependency_test.py | 4 ++++ files/vts_vndk_files_test.py | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/abi/vts_vndk_abi_test.py b/abi/vts_vndk_abi_test.py index f9c81f2..a14c9bb 100644 --- a/abi/vts_vndk_abi_test.py +++ b/abi/vts_vndk_abi_test.py @@ -19,6 +19,7 @@ import json import logging import os import shutil +import sys import tempfile import unittest @@ -358,6 +359,9 @@ class VtsVndkAbiTest(unittest.TestCase): if __name__ == "__main__": + # The logs are written to stdout so that TradeFed test runner can parse the + # results from stderr. + logging.basicConfig(stream=sys.stdout) # Setting verbosity is required to generate output that the TradeFed test # runner can parse. unittest.main(verbosity=3) diff --git a/dependency/vts_vndk_dependency_test.py b/dependency/vts_vndk_dependency_test.py index cd1ccf0..fb0431a 100644 --- a/dependency/vts_vndk_dependency_test.py +++ b/dependency/vts_vndk_dependency_test.py @@ -23,6 +23,7 @@ import os import posixpath as target_path_module import re import shutil +import sys import tempfile import unittest @@ -461,6 +462,9 @@ class VtsVndkDependencyTest(unittest.TestCase): if __name__ == "__main__": + # The logs are written to stdout so that TradeFed test runner can parse the + # results from stderr. + logging.basicConfig(stream=sys.stdout) # Setting verbosity is required to generate output that the TradeFed test # runner can parse. unittest.main(verbosity=3) diff --git a/files/vts_vndk_files_test.py b/files/vts_vndk_files_test.py index 907b15b..51da520 100644 --- a/files/vts_vndk_files_test.py +++ b/files/vts_vndk_files_test.py @@ -18,6 +18,7 @@ import logging import os import posixpath as target_path_module +import sys import unittest from vts.testcases.vndk import utils @@ -180,6 +181,9 @@ class VtsVndkFilesTest(unittest.TestCase): if __name__ == "__main__": + # The logs are written to stdout so that TradeFed test runner can parse the + # results from stderr. + logging.basicConfig(stream=sys.stdout) # Setting verbosity is required to generate output that the TradeFed test # runner can parse. unittest.main(verbosity=3) -- cgit v1.2.3