From b85851e510bdf13cef770981f76a403bc20b12da Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 19 Nov 2017 16:11:33 +0100 Subject: 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. --- test/integration/framework | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'test') 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 -- cgit v1.2.3