]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Allow py.test system test to skip itself
authorPetr Špaček <pspacek@isc.org>
Tue, 22 Jun 2021 14:11:26 +0000 (16:11 +0200)
committerPetr Špaček <pspacek@isc.org>
Mon, 8 Nov 2021 12:23:03 +0000 (13:23 +0100)
Enable use of shortcuts like pytest.importorskip and other tricks
which can cause test to skip itself.

bin/tests/system/run.sh.in

index c940ba22f78434917b1107ad1c7f229086c9e03a..6a6d53ccd1a2159095100b7653db89da0e0c0077 100644 (file)
@@ -201,20 +201,25 @@ fi
 
 if [ $status -eq 0 ]; then
     if [ -n "$PYTEST" ]; then
-        run=$((run+1))
         for test in $(cd "${systest}" && find . -name "tests*.py"); do
             if start_servers; then
-                rm -f "$systest/$test.status"
+                run=$((run+1))
                 test_status=0
                 (cd "$systest" && "$PYTEST" -v "$test" "$@" || echo "$?" > "$test.status") | SYSTESTDIR="$systest" cat_d
                 if [ -f "$systest/$test.status" ]; then
-                    echo_i "FAILED"
-                    test_status=$(cat "$systest/$test.status")
+                    if [ "$(cat "$systest/$test.status")" = "5" ]; then
+                        echowarn "R:$systest:SKIPPED"
+                    else
+                        echo_i "FAILED"
+                        test_status=$(cat "$systest/$test.status")
+                    fi
                 fi
                 status=$((status+test_status))
                 stop_servers || status=1
             else
                 status=1
+            fi
+            if [ $status -ne 0 ]; then
                 break
             fi
         done