From f16ab115ed7b76f3b21403a5bb789dfb9fa95c20 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Mon, 18 Mar 2024 14:39:44 -0600 Subject: [PATCH] logformatter: handle Windows logs C-colon and backslashes and ^Ms oh my Tested on sample failure and success logs, seems to work. Signed-off-by: Ed Santiago --- contrib/cirrus/logformatter | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/contrib/cirrus/logformatter b/contrib/cirrus/logformatter index 64b4a3bdc9db..a3b66cd20c98 100755 --- a/contrib/cirrus/logformatter +++ b/contrib/cirrus/logformatter @@ -327,6 +327,11 @@ END_HTML # 1 123 3 4 425 5 $line =~ s{^(.*/ci/task-\d+)((/\S+):(\d+))(.*)$} {$1$2$5}; + + # ...as does Windows + # 1 123 3 4 435 5 + $line =~ s{^(.*/Local/cirrus-ci-build/repo)((/\S+):(\d+))(.*)$} + {$1$2$5} } # Try to identify the cirrus task @@ -603,6 +608,11 @@ END_HTML $current_output = ''; } + # Windows + # 1 12 2 3 3 + elsif ($line =~ /^(\s*)(C:\\Users.*\\podman\.exe)\s(.*)$/) { + $line = qq{$1C> podman.exe $3}; + } elsif ($line =~ /^\s*Error:/ || $line =~ / level=(warning|error) /) { $line = "" . $line . ""; } @@ -660,7 +670,7 @@ END_HTML # https://onsi.github.io/ginkgo/#generating-reports-programmatically $after_divider = 999; } - elsif ($line =~ m!^\s*/\S+!) { + elsif ($line =~ m!^\s*(/\S+|C:/)!) { # Source code path: skip } elsif ($line =~ / 'doesnt'