]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Report reasons for skipped/xfailed system pytests
authorTom Krizek <tkrizek@isc.org>
Wed, 15 Jun 2022 13:00:27 +0000 (15:00 +0200)
committerTom Krizek <tkrizek@isc.org>
Thu, 16 Jun 2022 07:13:53 +0000 (09:13 +0200)
If skip/xfail is used in pytest, it can have a reason string associated
with it. When evaluating these tests, it can be useful to be able to
differentiate the reason why the test was skipped/xfailed/xpassed,
because there might be multiple possible reasons for that.

The extra options passed to pytest ensure that the string with the
reason appears in the test summary and thus we're able to find the
string with the reason in the log output.

See https://docs.pytest.org/en/7.1.x/how-to/skipping.html for more info

bin/tests/system/run.sh.in

index 87a98bc67186f8be370c400278f00c9b8f8e5172..0341a33f126b5e31682bdf186988fef0f9b5da93 100644 (file)
@@ -227,7 +227,7 @@ if [ $status -eq 0 ]; then
             if start_servers; then
                 run=$((run+1))
                 test_status=0
-                (cd "$systest" && "$PYTEST" -v "$test" "$@" || echo "$?" > "$test.status") | SYSTESTDIR="$systest" cat_d
+                (cd "$systest" && "$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"