From 81085451f4773f920ce0142c4c5490b59dafb9a9 Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Thu, 10 Mar 2022 10:20:11 +0100 Subject: [PATCH] ci-automation/tapfile_helper_lib.sh: only ASCII chars This change removes all non-ASCII characters from test debug / error output when ingesting the output for inclusion in the TAP report. Jenkins TAP parser does not handle some unicode chars, leading to tap parser errors with e.g. Cilium output (which uses unicode). Signed-off-by: Thilo Fromm --- ci-automation/tapfile_helper_lib.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci-automation/tapfile_helper_lib.sh b/ci-automation/tapfile_helper_lib.sh index f360cc9807..8dd12de11b 100644 --- a/ci-automation/tapfile_helper_lib.sh +++ b/ci-automation/tapfile_helper_lib.sh @@ -122,10 +122,12 @@ function tap_ingest_tapfile() { in_error_message=false has_error_message="true" else + # remove special characters and unicode. Jenkins TAP parser don't unicode. echo -e "$line" \ - | sed -e 's/^Error: "--- FAIL: /"/' -e 's/^[[:space:]]*//' \ + | LC_ALL=C sed -e 's/^Error: "--- FAIL: /"/' -e 's/^[[:space:]]*//' \ -e "s/[>\\\"']/_/g" -e 's/[[:space:]]/ /g' \ -e 's/.\{200\}/&\n/g' \ + -e 's/[^\x00-\x7F]/?/g' \ >> "${error_message_file}" continue fi