[tor-commits] [tor/master] practracker: Fail tests if any process exits unexpectedly

teor at torproject.org teor at torproject.org
Wed Jan 15 12:32:32 UTC 2020


commit eb55d85e757c62a483e0e4ccb231ec33a1df84f3
Author: teor <teor at torproject.org>
Date:   Tue Jan 14 17:20:36 2020 +1000

    practracker: Fail tests if any process exits unexpectedly
    
    Part of 32705.
---
 scripts/maint/practracker/test_practracker.sh | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/scripts/maint/practracker/test_practracker.sh b/scripts/maint/practracker/test_practracker.sh
index 3c87bc31b..43e7b0a32 100755
--- a/scripts/maint/practracker/test_practracker.sh
+++ b/scripts/maint/practracker/test_practracker.sh
@@ -1,5 +1,8 @@
 #!/bin/sh
 
+# Fail if any subprocess fails unexpectedly
+set -e
+
 umask 077
 
 TMPDIR=""
@@ -37,11 +40,11 @@ run_practracker() {
         --max-h-include-count=0 \
         --max-include-count=0 \
         --terse \
-        "${DATA}/" "$@";
+        "${DATA}/" "$@" || true
 }
 compare() {
     # we can't use cmp because we need to use -b for windows
-    diff -b -u "$@" > "${TMPDIR}/test-diff"
+    diff -b -u "$@" > "${TMPDIR}/test-diff" || true
     if test -z "$(cat "${TMPDIR}"/test-diff)"; then
         echo "OK"
     else
@@ -53,7 +56,7 @@ compare() {
 
 echo "unit tests:"
 
-"${PYTHON:-python}" "${PRACTRACKER_DIR}/practracker_tests.py" || exit 1
+"${PYTHON:-python}" "${PRACTRACKER_DIR}/practracker_tests.py"
 
 echo "ex0:"
 





More information about the tor-commits mailing list