Skip to content

Commit bd0b557

Browse files
committed
t4080: skip when no python interpreter is available at runtime
`t4080-diff-process.sh` invented its own way of locating a python interpreter (a runtime `command -v python3 || command -v python` lookup that overrode the build-time `PYTHON_PATH`), and gated the test only on the build-time `PYTHON` prereq. That paradigm differs from how the existing python-using tests in `lib-git-p4.sh` handle the same question, which combines the `PYTHON` build-time prereq with the build-time `$PYTHON_PATH` directly. The mismatch is unnecessary and surprising: it duplicates intent, ignores the configured interpreter the rest of the suite agrees on, and still fails in the most relevant case. That most relevant case is environments where Git was configured with Python support (so `PYTHON` is on) but no python interpreter exists on the runtime PATH, such as the minimal Git for Windows SDK where Perl pulls the Python bindings into the build but no interpreter is installed. There t4080 would wire the diff backend to an empty or unresolvable interpreter, and every subsequent test would fail on the first backend invocation with a misleading error. Align t4080 with `lib-git-p4.sh`: rely on the `PYTHON` prereq for the build-time signal, additionally verify that the configured `$PYTHON_PATH` is actually executable at runtime, and announce a single `skip_all` when either condition fails. The bespoke `command -v` shimmery is no longer needed. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent ac66243 commit bd0b557

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

t/t4080-diff-process.sh

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

55
. ./test-lib.sh
66

7-
if test_have_prereq PYTHON
7+
if ! test_have_prereq PYTHON || ! test -x "$PYTHON_PATH"
88
then
9-
PYTHON_PATH=$(command -v python3) || PYTHON_PATH=$(command -v python)
9+
skip_all='python interpreter not available'
10+
test_done
1011
fi
1112

1213
#

0 commit comments

Comments
 (0)