aglinxinyuan opened a new pull request, #7480:
URL: https://github.com/apache/texera/pull/7480
### What changes were proposed in this PR?
The PVE block is the largest uncovered region in this component, and the
existing suite stops exactly at its seams: it stubs `runPveWebSocket` and
`deleteUserPackages` so it can assert name validation without opening a socket.
These drive the other side of those seams.
Adds 9 tests using a stand-in `WebSocket`, so `onmessage` and `onerror` can
be fired by hand. Covered: the socket opening and locking the card, the name
being trimmed before it reaches the URL, server lines appending to the pip
output, the `__DONE__` sentinel closing the socket and clearing installing
without printing itself, a dropped connection surfacing as output rather than a
hang, a still-open socket being closed before another starts, and the create
path chaining delete-then-install.
**Verified by mutation**, all reverted (production diff empty):
| Mutation | Result |
|---|---|
| name not trimmed for the socket URL | red |
| previous socket left open | red |
| card not locked while installing | red |
| sentinel not recognised | red |
| done leaves installing set | red |
| done does not close the socket | red |
| done skips the continuation | red |
| error not surfaced in the output | red |
| error leaves the card installing | red |
The "done leaves installing set" mutation **survived a first pass**, and the
reason is worth recording: the test let the real delete/install continuation
run, which resets `isInstalling` downstream — so it was observing the
continuation's state, not the sentinel branch's. Stubbing the continuation is
what makes the test discriminate, and that is commented in the spec.
No production file is touched.
### Any related issues, documentation, discussions?
Closes #7477
### How was this PR tested?
```
npx ng test --watch=false
--include="**/computing-unit-selection.component.spec.ts"
```
```
Test Files 1 passed (1)
Tests 109 passed (109)
```
9 new on top of the existing 100. `yarn format:ci` passes.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)
--
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]