test-bugzilla-files/crashtest-extract.sh |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

New commits:
commit f085f72c95217bcb63f225a97feea0b58dd1658d
Author:     Gabor Kelemen <kelem...@gnome.hu>
AuthorDate: Tue Jun 11 16:55:57 2024 +0200
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu Jun 13 15:01:56 2024 +0200

    Add crashtest-extract.sh convenience script
    
    to copy problematic files out of the file pile
    useful for us in case the Jenkins workspace is on
    a different server than the backend with the files
    
    Change-Id: I28e2ed9c547f6090ed4dfce4e542fc87d1e1f7f0
    Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/168688
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/test-bugzilla-files/crashtest-extract.sh 
b/test-bugzilla-files/crashtest-extract.sh
new file mode 100755
index 00000000..27d00285
--- /dev/null
+++ b/test-bugzilla-files/crashtest-extract.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+# For convenience, copy files that caused crashes into a subdir along the logs
+# Run this from the output directory, after commands.sh
+# Useful to run on Jenkins which runs the testing on a different machine than 
itself
+
+# extract current test runs hash
+currentdir=$(grep crashtest/ mail.txt | cut -d / -f 5)
+
+# create dir for storing files crashing at import
+mkdir -p "$currentdir"/importcrashfiles;
+
+# create dir for storing files crashing at export
+mkdir -p "$currentdir"/exportcrashfiles;
+
+# copy files causing import crash to separate subdir
+while read currentline ; do
+    # extract file name from log file
+    importcrash=$(echo $currentline | awk -F'[: ]' '{print $2}');
+    # copy crashed file to separate dir
+    cp "$importcrash" "$currentdir"/importcrashfiles;
+done < "$currentdir"/crashlog.txt
+
+while read exportline ; do
+    # extract file path+basename from log file, extension is not relevant
+    exportcrash=$(echo $exportline | cut -d . -f 1);
+    # copy source file that caused an export crash
+    cp "$exportcrash*" "$exportcrashfiles";
+done < "$currentdir"/exportCrash.txt

Reply via email to