]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove pytest invocation from legacy runner
authorTom Krizek <tkrizek@isc.org>
Tue, 15 Aug 2023 11:40:13 +0000 (13:40 +0200)
committerTom Krizek <tkrizek@isc.org>
Wed, 20 Sep 2023 12:50:18 +0000 (14:50 +0200)
In order to python system tests, pytest (runner) has to be used
directly. This makes it possible to simplify the pytest runner and make
its behavior simpler and easier to extend.

The legacy runner can still be used to run shell system tests.

(cherry picked from commit 4af9bafb4eb0a0c3785119f8a577454f5ad6e068)

bin/tests/system/legacy.run.sh.in

index 501e554e3d2559bae7a9e49271448568d5fdba6d..39be8178aa8599b18fe0396393d94bc508e4ac40 100644 (file)
@@ -84,7 +84,7 @@ if [ "${srcdir}" != "${builddir}" ]; then
         cp -a "${srcdir}/_common" "${builddir}"
     fi
     # Some tests require additional files to work for out-of-tree test runs.
-    for file in ckdnsrps.sh conftest.py digcomp.pl ditch.pl fromhex.pl get_core_dumps.sh kasp.sh packet.pl pytest_custom_markers.py start.pl stop.pl testcrypto.sh; do
+    for file in ckdnsrps.sh conftest.py digcomp.pl ditch.pl fromhex.pl get_core_dumps.sh kasp.sh packet.pl start.pl stop.pl testcrypto.sh; do
         if [ ! -r "${file}" ]; then
             cp -a "${srcdir}/${file}" "${builddir}"
         fi
@@ -193,37 +193,6 @@ if [ -r "$systest/tests.sh" ]; then
     fi
 fi
 
-if [ $status -eq 0 ]; then
-    if [ -n "$PYTEST" ]; then
-        for test in $(cd "${systest}" && find . -name "tests*.py" ! -name "tests_sh_*.py"); do
-            rm -f "$systest/$test.status"
-            if start_servers; then
-                run=$((run+1))
-                test_status=0
-                (cd "$systest" && LEGACY_TEST_RUNNER=1 "$PYTEST" -rsxX -v "$test" "$@" || echo "$?" > "$test.status") | SYSTESTDIR="$systest" cat_d
-                if [ -f "$systest/$test.status" ]; then
-                    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
-        rm -f "$systest/$test.status"
-    else
-        echoinfo "I:$systest:pytest not installed, skipping python tests"
-    fi
-fi
-
 if [ "$run" -eq "0" ]; then
     echoinfo "I:$systest:No tests were found and run"
     status=255