[PATCH] osmo-iuh[master]: jenkins.sh: cat all test logs when build failed

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Sep 21 22:34:53 UTC 2016


Review at  https://gerrit.osmocom.org/868

jenkins.sh: cat all test logs when build failed

Add cat_testlogs.sh, call from jenkins.sh

Change-Id: I6ee37ae638aa0b95222e5c0ec78474fab1f8cfae
---
A contrib/cat_testlogs.sh
M contrib/jenkins.sh
2 files changed, 25 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/68/868/1

diff --git a/contrib/cat_testlogs.sh b/contrib/cat_testlogs.sh
new file mode 100755
index 0000000..0d34a18
--- /dev/null
+++ b/contrib/cat_testlogs.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# Intended for use in jenkins build jobs, like this:
+#    $MAKE check || ./contrib/cat_testlogs.sh
+#
+# In the jenkins console output, show the actual failures by printing the test
+# logs to the console output. This way we can see how exactly the test failed
+# even if a job is older and no workspace is available.
+
+set +x
+find . -path "*/testsuite.dir/*/testsuite.log" | while read testlog; do
+  echo
+  echo
+  echo
+  echo ======================== "$testlog"
+  echo
+  cat $testlog
+done
+
+# this will be called after a test failure, so make sure to return an error
+exit 1
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 8021bbd..85f2147 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -74,5 +74,7 @@
 fi
 
 $MAKE $PARALLEL_MAKE
-LD_LIBRARY_PATH="$inst/lib" $MAKE check
-LD_LIBRARY_PATH="$inst/lib" $MAKE distcheck
+LD_LIBRARY_PATH="$inst/lib" $MAKE check \
+  || ./contrib/cat_testlogs.sh
+LD_LIBRARY_PATH="$inst/lib" $MAKE distcheck \
+  || ./contrib/cat_testlogs.sh

-- 
To view, visit https://gerrit.osmocom.org/868
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ee37ae638aa0b95222e5c0ec78474fab1f8cfae
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list