summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Grandi <agrandi@google.com>2022-12-27 15:44:25 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-01-03 22:20:46 +0000
commit9e599bc7f65ec16daeb82ccacf93b8574ce1db85 (patch)
tree1d16020ddcae4f46e17860b63fa9c1d5eefa828c
parent67fbc7ef3e33933db90d427044aa97c3c56e287b (diff)
downloadchrome-ec-9e599bc7f65ec16daeb82ccacf93b8574ce1db85.tar.gz
run_device_tests.py: Improve logs readability
The output logs from the FPMCU are not decoded and can be hard to read. Improve readability by decoding escape characters (e.g. \n) and by reducing the size of the log lines header. Before: DEBUG:root:b'Running test_num_iterations...\r\n' DEBUG:root:b'Pass: num_calls == 5\r\n' After: DEBUG:Running test_num_iterations... DEBUG:Pass: num_calls == 5 BUG=b:263804978 TEST=test/run_device_tests.py -b bloonchipper -t benchmark BRANCH=none Change-Id: Ie0332cd100d83e8daaf0ee4b41997b97242c58a6 Signed-off-by: Andrea Grandi <agrandi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4126660 Reviewed-by: Josie Nordrum <josienordrum@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
-rwxr-xr-xtest/run_device_tests.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/run_device_tests.py b/test/run_device_tests.py
index c5e7adf70e..c75639a948 100755
--- a/test/run_device_tests.py
+++ b/test/run_device_tests.py
@@ -633,7 +633,7 @@ def run_test(
return False
continue
- logging.debug(line)
+ logging.debug(line.decode("utf-8").rstrip())
test.logs.append(line)
# Look for test_print_result() output (success or failure)
line_str = process_console_output_line(line, test)
@@ -859,7 +859,9 @@ def main():
)
args = parser.parse_args()
- logging.basicConfig(level=args.log_level)
+ logging.basicConfig(
+ format="%(levelname)s:%(message)s", level=args.log_level
+ )
validate_args_combination(args)
board_config = BOARD_CONFIGS[args.board]