]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Prevent .hypothesis artifacts in system test directories
authorEvan Hunt <each@isc.org>
Thu, 29 May 2025 17:55:25 +0000 (10:55 -0700)
committerEvan Hunt <each@isc.org>
Tue, 3 Jun 2025 07:35:18 +0000 (07:35 +0000)
The "run.sh" script, used by "make test", changes the working
directory to the system test directory before executing pytest.
If the test drops hypothesis artifacts while running, this
can cause spurious test failures due to an apparent mismatch
between the contents of the system test directory and the
temporary pytest directory. This has been addressed by having
"run.sh" call pytest from the parent directory instead.

bin/tests/system/run.sh

index c6d0485563509ee4265e63b5a4929528d7241bc4..887254568df9f25ecf49a10467450699fb0d8b3d 100755 (executable)
@@ -22,9 +22,11 @@ if [ -z "$1" ] || [ ! -d "$1" ]; then
 fi
 
 system_test_dir="$1"
+system_test="$(basename $system_test_dir)"
 shift
 
 (
-  cd "$system_test_dir" || exit 2
-  /usr/bin/env python3 -m pytest "$@"
+  [ -d "$system_test_dir" ] || exit 2
+  cd "${system_test_dir}/.."
+  /usr/bin/env python3 -m pytest "$@" "$system_test"
 )