summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2017-11-19 16:11:33 +0100
committerJulian Andres Klode <jak@debian.org>2017-11-22 21:35:51 +0100
commitb85851e510bdf13cef770981f76a403bc20b12da (patch)
treef723c22cdb78858c225de43b43ae93b6e651325a
parentdfb4c178b4f6a7db255cbc7dc2b162721d807b58 (diff)
tests: Improve handling profiling messages on CI
We did not strip away profiling messages when we were diffing from stdin (-). Just always write temporary files and strip from them. We also had a problem when stripping ...profiling: from a line and the next line starts with profiling. Split the sed into two calls so we first remove complete profiling: lines before fixing the ...profiling: cases.
-rw-r--r--test/integration/framework22
1 files changed, 12 insertions, 10 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 701aa60b0..bf6a8155e 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -1423,20 +1423,22 @@ downloadfile() {
fi
}
+cleanup_output() {
+ cat "$1" | sed \
+ -e '/gpgv: WARNING: This key is not suitable for signing in --compliance=gnupg mode/ d' \
+ -e '/^profiling:/ d' \
+ | sed -e '/\.\.\.profiling:/ {N;s#\.\.\.profiling:.*\n#...#g}' \
+ >"$2"
+}
+
checkdiff() {
local TMPFILE1="${TMPWORKINGDIRECTORY}/rootdir/tmp/checkdiff.1.tmp"
local TMPFILE2="${TMPWORKINGDIRECTORY}/rootdir/tmp/checkdiff.2.tmp"
touch "$TMPFILE1" "$TMPFILE2"
- if [ "$1" != '-' ]; then
- sed -e '/gpgv: WARNING: This key is not suitable for signing in --compliance=gnupg mode/ d' -e '/^profiling:/ d' -e '/\.\.\.profiling:/{N;s#\.\.\.profiling:.*\n#...#g}' < "$1" >"$TMPFILE1"
- else
- TMPFILE1='-'
- fi
- if [ "$2" != '-' ]; then
- sed -e '/gpgv: WARNING: This key is not suitable for signing in --compliance=gnupg mode/ d' -e '/^profiling:/ d' -e '/\.\.\.profiling:/{N;s#\.\.\.profiling:.*\n#...#g}' < "$2" >"$TMPFILE2"
- else
- TMPFILE2='-'
- fi
+
+ cleanup_output "$1" "$TMPFILE1"
+ cleanup_output "$2" "$TMPFILE2"
+
local DIFFTEXT="$(command diff -u "$TMPFILE1" "$TMPFILE2" 2>&1 | sed -e '/^---/ d' -e '/^+++/ d' -e '/^@@/ d')"
if [ -n "$DIFFTEXT" ]; then
echo >&2