Commit 93b3ee9
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | | - | |
| 13 | + | |
| 14 | + | |
10 | 15 | | |
11 | 16 | | |
12 | 17 | | |
| |||
0 commit comments