summaryrefslogtreecommitdiff
path: root/reference.md
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-06-16 09:56:26 +0300
committerLars Wirzenius <liw@liw.fi>2021-06-16 10:42:17 +0300
commit4ce46e7ace32b521b3f503ca9b533964d2ad57a2 (patch)
tree575a00ec08079bde5411c79debb92ae4ab6d09f8 /reference.md
parent6aeacebbf5f5e03257deb87b63048e27906dbe64 (diff)
downloadsubplot-4ce46e7ace32b521b3f503ca9b533964d2ad57a2.tar.gz
test: have ./check tail the test.py log file on failure
For each subplot, if running the test program fails, the last 100 lines of the log file is output. For the reference.md subplot, the last 100 lines of the log file for the test program from the referenced subplot is output. This makes it easier to debug failures in CI. Sponsored-by: author
Diffstat (limited to 'reference.md')
-rw-r--r--reference.md21
1 files changed, 20 insertions, 1 deletions
diff --git a/reference.md b/reference.md
index 09ac659..48e2295 100644
--- a/reference.md
+++ b/reference.md
@@ -1,3 +1,4 @@
+
# Introduction
This document describes how we guard against accidental breaking
@@ -40,7 +41,25 @@ then command is successful
#!/bin/bash
set -euo pipefail
-python3 src/test-inner.py --log test-inner.log --env "PATH=$PATH" --env SUBPLOT_DIR=/
+
+N=100
+
+if python3 src/test-inner.py --log test-inner.log --env "PATH=$PATH" --env SUBPLOT_DIR=/
+then
+ exit=0
+else
+ exit="$?"
+fi
+
+if [ "$exit" != 0 ]
+then
+ # Failure. Show end of inner log file.
+
+ echo "last $N lines of test-inner.log:"
+ tail "-n$N" test-inner.log | sed 's/^/ /'
+fi
+
+exit "$exit"
~~~