unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] test: report summary even when aborting
@ 2019-05-25 17:30 Daniel Kahn Gillmor
  2019-05-25 19:41 ` Tomi Ollila
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Kahn Gillmor @ 2019-05-25 17:30 UTC (permalink / raw
  To: Notmuch Mail

In certain cases of test suite failure, the summary report was not
being printed.  In particular, any failure on the parallel test suite,
and any aborted test in the serialized test suite would end up hiding
the summary.

It's better to always show the summary where we can (while preserving
the return code).

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
---
 test/notmuch-test | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/test/notmuch-test b/test/notmuch-test
index 50ed8721..d835e152 100755
--- a/test/notmuch-test
+++ b/test/notmuch-test
@@ -45,6 +45,8 @@ else
 fi
 
 trap 'e=$?; kill $!; exit $e' HUP INT TERM
+
+RES=0
 # Run the tests
 if test -z "$NOTMUCH_TEST_SERIALIZE" && command -v parallel >/dev/null ; then
     test -t 1 && export COLORS_WITHOUT_TTY=t || :
@@ -58,7 +60,6 @@ if test -z "$NOTMUCH_TEST_SERIALIZE" && command -v parallel >/dev/null ; then
     RES=$?
     if [[ $RES != 0 ]]; then
         echo "parallel test suite returned error code $RES"
-        exit $RES
     fi
 else
     for test in $TESTS; do
@@ -69,7 +70,7 @@ else
         RES=$?
         testname=$(basename $test .sh)
         if [[ $RES != 0 && ! -e "$NOTMUCH_BUILDDIR/test/test-results/$testname" ]]; then
-            exit $RES
+            echo "Aborting on $testname (returned $RES)"
         fi
     done
 fi
@@ -78,7 +79,11 @@ trap - HUP INT TERM
 # Report results
 echo
 $NOTMUCH_SRCDIR/test/aggregate-results.sh $NOTMUCH_BUILDDIR/test/test-results/*
-ev=$?
+if [ "$RES" = 0 ]; then
+    ev=$?
+else
+    ev=$RES
+fi
 
 # Clean up
 rm -rf $NOTMUCH_BUILDDIR/test/test-results
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-05-31 10:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-25 17:30 [PATCH] test: report summary even when aborting Daniel Kahn Gillmor
2019-05-25 19:41 ` Tomi Ollila
2019-05-26 15:03   ` [PATCH v2] " Daniel Kahn Gillmor
2019-05-26 21:35     ` Tomi Ollila
2019-05-26 21:56     ` David Bremner
2019-05-31 10:59     ` David Bremner
2019-05-26 15:06   ` [PATCH] " Daniel Kahn Gillmor

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).