From aa6a742efa9fd51e215b7bdd6ac3e92da3e8b2eb 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 32215bbbec..805ae62a8a 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