feat(rca): Print also last failure line 08/41808/2
authorVratko Polak <[email protected]>
Wed, 6 Nov 2024 14:04:22 +0000 (15:04 +0100)
committerVratko Polak <[email protected]>
Wed, 6 Nov 2024 14:04:22 +0000 (15:04 +0100)
This is mainly for easy detection of known issues,
so only new or unsure failures need closer investigation.

Change-Id: I6ebae2a0917ad229f9cfef5e56614b0a0ca73474
Signed-off-by: Vratko Polak <[email protected]>
resources/tools/scripts/rca_console_logs.sh

index 58d61a1..a541a3f 100644 (file)
@@ -50,6 +50,23 @@ for i in {1..999}; do
     if fgrep -q ', 0 failed' "final.txt"; then
         echo -ne "${i}: skip ${final}\t\t"
     else
+        echo
+#        fgrep '| FAIL' "console.log" | fgrep -v 'Tests'
+
+        awk '
+            /\| FAIL \|/ {
+                if ($0 !~ /Tests/) {
+                    print
+                    getline
+                    while ($0 !~ /^[-=]+$/) {
+                        last_line = $0
+                        getline
+                    }
+                    print last_line
+                }
+            }
+        ' "console.log"
+
         echo -ne "${i}: investigate ${final}\t\t"
     fi
     # TODO: Simplify this topology detection.