Skip to content

Commit 93b3ee9

Browse files
committed
t4080: skip when no python interpreter is available at runtime
The `PYTHON` prereq is a build-time signal: it merely indicates that Git was configured with Python support, not that a usable python interpreter exists at test time. On environments such as the minimal Git for Windows SDK, the build option stays on (Perl drags in the Python bindings) but the runtime PATH carries no python at all. Under that combination the test setup that consults `command -v python3` / `command -v python` cannot pick anything up, and every subsequent test runs the backend stub through an empty interpreter path. The previous attempt of merely clearing PYTHON_PATH on failure simply postponed the breakage from the script preamble to the first backend invocation. The honest answer for such an environment is: this test cannot run at all. Move the interpreter lookup to the top of the script and, when nothing is found, declare a `skip_all`. Other tests in the suite that need an external tool (notably the `git p4` family in `lib-git-p4.sh`) already follow this pattern: announce the missing prerequisite once and skip the file as a whole, rather than letting each `test_expect_success` produce its own confusing failure. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent ac66243 commit 93b3ee9

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

t/t4080-diff-process.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@ test_description='diff process via long-running process'
44

55
. ./test-lib.sh
66

7-
if test_have_prereq PYTHON
7+
PYTHON_PATH=$(command -v python3) ||
8+
PYTHON_PATH=$(command -v python) ||
9+
PYTHON_PATH=
10+
11+
if test -z "$PYTHON_PATH"
812
then
9-
PYTHON_PATH=$(command -v python3) || PYTHON_PATH=$(command -v python)
13+
skip_all='no python interpreter available'
14+
test_done
1015
fi
1116

1217
#

0 commit comments

Comments
 (0)