eugenegujing opened a new issue, #9647:
URL: https://github.com/apache/texera/issues/9647

   ### What happened?
   
   On Windows, `PveResourceSpec` fails 6 of its 52 tests. All six end at the 
same guard, `[PVE][ERR] Python executable not found for PVE: 
C:\tmp\texera-pve\venvs\...\pve\Scripts\python.exe`:
   
   - `PveManager should install a user package and list it for the PVE`
   - `PveManager should delete a user package and remove it from the PVE 
package list`
   - `PveManager should refuse to install a package that is part of the system 
set`
   - `PveManager should report an error when a user package install fails`
   - `PveManager.getPythonBin should return Some for an existing venv`
   - `PveResource.deletePackage should return 200 when the uninstall succeeds`
   
   `PveManager.venvPython` (`PveManager.scala:72-78`) looks for the interpreter 
at `<venv>/Scripts/python.exe` on Windows and at `<venv>/bin/python` elsewhere. 
The spec's fake process runner replaces `python -m venv`, and it always writes 
`<venv>/bin/python` and `<venv>/bin/pip` (`PveResourceSpec.scala:115-123`). So 
on Windows, a PVE created through `createNewPve` has no interpreter where 
`PveManager` looks for one. As a result, the existence checks in 
`installUserPackages` (`:452`), `deletePackages` (`:524`) and `getPythonBin` 
(`:92`) all report it missing.
   
   The spec already knows the two layouts differ. `pythonBinFor` (`:180-185`) 
and `fabricatePve` (`:191-203`) follow `PveManager`'s rule, and the doc on 
`fabricatePve` says the create flow "cannot stand a PVE up on a platform whose 
interpreter lives somewhere else". Only the tests that skip `createNewPve` use 
these helpers. Two more assertions hard-code the POSIX path: `bin/python` and 
`bin/pip` at `:248-249`, and `endWith(s"$testPveName/pve/bin/python")` at 
`:403`. They pass on Windows only because they check the files the fake itself 
wrote.
   
   To confirm the cause, I made the fake runner temporarily write 
`Scripts/python.exe` and `Scripts/pip.exe` on Windows. With that change the six 
tests pass, and the two hard-coded assertions fail instead (49 succeeded, 2 
failed).
   
   CI does not see this. The `amber` job runs only on `ubuntu-latest` 
(`.github/workflows/build.yml:197-206`); the `windows-latest` leg belongs to 
the `frontend` job (`:86-109`). Windows contributors get six red tests on every 
amber run, and their local coverage of `PveManager` takes the "interpreter 
missing" branches where CI takes the other ones.
   
   ### How to reproduce?
   
   On Windows: `sbt "WorkflowExecutionService/testOnly 
org.apache.texera.web.resource.pythonvirtualenvironment.PveResourceSpec"`
   
   Observed: `Tests: succeeded 45, failed 6, canceled 1`, with the six tests 
listed above failing.
   
   ### Version/Branch
   
   1.4.0-incubating-SNAPSHOT (main)
   
   ### Commit Hash (Optional)
   
   _No response_
   
   ### What browsers are you seeing the problem on?
   
   _No response_
   
   ### Relevant log output
   
   ```shell
   
   ```


-- 
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