eugenegujing opened a new pull request, #9648:
URL: https://github.com/apache/texera/pull/9648

   ### What changes were proposed in this PR?
   
   `PveResourceSpec` fails 6 of its 52 tests on Windows. Its fake `python -m 
venv` runner always wrote `<venv>/bin/python` and `<venv>/bin/pip`, while 
`PveManager.venvPython` looks for `<venv>/Scripts/python.exe` on Windows, so 
every test that created a PVE through `createNewPve` ended at `[PVE][ERR] 
Python executable not found for PVE`.
   
   ```
   Before (Windows):  fake venv writes bin/python       -> PveManager looks in 
Scripts/python.exe -> "not found", 6 tests fail
   After  (Windows):  fake venv writes Scripts/python.exe -> PveManager finds 
it                  -> 0 tests fail
   Linux / macOS:     fake venv writes bin/python, as before
   ```
   
   The change is in the spec only:
   
   | Where | Before | After |
   | --- | --- | --- |
   | New `venvExecutable(venv, name)` | the platform rule lived only in 
`pythonBinFor` | one helper holds it: `bin/<name>` on POSIX, 
`Scripts/<name>.exe` on Windows; `pythonBinFor` delegates to it |
   | Fake venv runner | wrote `bin/python`, `bin/pip` | writes both through 
`venvExecutable` |
   | "create a new PVE" assertions | `bin/python`, `bin/pip` literals | 
`venvExecutable(pvePath, ...)` |
   | `getPythonBin should return Some` assertion | 
`endWith("<name>/pve/bin/python")` | 
`endWith(testRoot.relativize(pythonBinFor(name)).toString)`, the same string on 
POSIX |
   
   Two comments that described the fake as POSIX-only are updated to match. 
Nothing under `src/main` changes, and on POSIX the spec writes the same files 
and asserts the same strings as before.
   
   ### Any related issues, documentation, discussions?
   
   Closes #9647
   
   The test notes of #7800, #7847, #7852 and #8036 mention these six failures 
as pre-existing on Windows.
   
   ### How was this PR tested?
   
   On Windows 11:
   
   ```bash
   sbt "WorkflowExecutionService/testOnly 
org.apache.texera.web.resource.pythonvirtualenvironment.PveResourceSpec"
   ```
   
   | | succeeded | failed | canceled |
   | --- | --- | --- | --- |
   | main | 45 | 6 | 1 |
   | this PR | 51 | 0 | 1 |
   
   The canceled test is `PveManager.getPythonBin should return nothing when the 
interpreter exists but is not executable`: its own `assume` cancels it because 
Windows cannot clear the executable bit, before and after this change.
   
   ```bash
   sbt scalafmtCheckAll
   sbt "scalafixAll --check"
   ```
   
   Both pass. The spec was not run on Linux locally; CI covers that.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Yes. Generated-by: Claude Code (claude-fable-5-2). Co-authored with Claude; 
the author reviewed the change before submission.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to