Repository navigation
Commit d409f59
authored
test: pin the suite interpreter on PATH for parity script subprocesses (#5361)
* test: pin the suite interpreter on PATH for parity script subprocesses
The parity tests' script variants resolve python3 -> python -> py -3
through the ambient PATH. Under `uv run pytest` the venv's bin directory
is first on PATH, so the scripts see the suite interpreter (with PyYAML)
and CI passes. Under the direct `.venv/bin/python -m pytest` invocation
that AGENTS.md prescribes, an ambient python3 without PyYAML fails every
composed-template test with "PyYAML is required" (11 failures on macOS).
Prepend the running interpreter's own bin directory in
parity_helpers.clean_env() so both invocations behave the same; tests
that install their own shim prepend afterwards and keep precedence.
Delegate test_check_prerequisites_python_parity's duplicate _clean_env()
to the shared helper so the fix applies there too.
Fixes #5359
AI disclosure: agent-authored commit — OpenCode running GLM 5.3 Flash
(Z.ai), agent mode under human supervision by mehdikarimi55; root-cause
analysis, code change, and test execution performed by the agent.
* test: cover the python3 resolver's first candidate on Windows too
Copilot review follow-up (#5361): a Windows venv ships python.exe but no
python3.exe, so putting the venv's bin directory first on PATH cannot
shadow an ambient python3 — the first name the script resolvers probe
(command -v python3 succeeds and wins before the python fallback is
tried). clean_env() now also prepends a cached python3 shim built with
the existing make_python3_path_shim() helper (shell shim plus a .cmd for
PowerShell), so parity subprocesses resolve the suite interpreter on
every platform.
AI disclosure: agent-authored commit — OpenCode running GLM 5.3 Flash
(Z.ai), agent mode under human supervision by mehdikarimi55; fix drafted
in response to the Copilot review finding, verified by rerunning the
affected parity suites.
* test: survive missing Git Bash when building the Windows python3 shim
Copilot review follow-up (#5361): _bash_posix_path() shells out to bash
on Windows to convert the interpreter path, and a Windows machine with
Git Bash not on PATH raised FileNotFoundError from clean_env() itself,
failing every parity test during environment setup — including the
python and PowerShell variants that never invoke bash. Catch the OSError
and fall through to the static /mnt/ form, which the existing returncode
fallback already accepts; bash-invoked tests skip when bash is absent,
so the converted form is only needed where it can be exec'd.
AI disclosure: agent-authored commit — OpenCode running GLM 5.3 Flash
(Z.ai), agent mode under human supervision by mehdikarimi55; fix for the
review finding, verified locally with the parity suites and a simulated
no-bash subprocess failure.
---------
Co-authored-by: mehdikarimi55 <9496476+mehdikarimi55@users.noreply.github.com>1 parent d38bf46 commit d409f59
2 files changed
Lines changed: 66 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
93 | 113 | | |
94 | 114 | | |
95 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
96 | 133 | | |
97 | 134 | | |
98 | 135 | | |
| |||
135 | 172 | | |
136 | 173 | | |
137 | 174 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
151 | 196 | | |
152 | 197 | | |
153 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| |||
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
0 commit comments