The GitHub Actions job "Required Checks" on 
texera.git/gh-readonly-queue/main/pr-7696-0de241723eb80ac23cc765d2b22c20bb7321bb9b
 has failed.
Run started by GitHub user aglinxinyuan (triggered by aglinxinyuan).

Head commit for run:
bf1a4e7453c22169b0d89a8c6f51c2583381e889 / Xinyuan Lin <[email protected]>
test(frontend): cover the websocket handshake, port editor binding and quota 
charts (#7696)

### What changes were proposed in this PR?

Three frontend files that sat below their neighbours, all with untested
behaviour rather than tooling problems (these are `.ts` files, so
#7458's template attribution does not apply).

| File | Before | After |
|---|---|---|
| `user-quota.component.ts` | 90.1% | **140/140 lines, 34/34 branches,
36/36 functions** |
| `port-property-edit-frame.component.ts` | 86.5% | **72/74 (97.3%)** |
| `workflow-websocket.service.ts` | 76.0% | **45/48 (93.8%)**, 15/15
branches |

Tests **47 -> 70**.

Covered: the handshake URL's query construction and the heartbeat
interval; the Yjs/Quill shared binding, its awareness and cursors
module, and the three DOM triggers that drive it; and the quota
component's per-day aggregation, its chart wiring, and the accumulator
reset that makes a reload idempotent.

### Verification

The build applied 26 mutations. Review then proposed 23 more, and
**every one of the 23 was real -- none was refutable.** 33 distinct
mutations were run in total (~54 runs), one at a time, anchor uniqueness
asserted, reverted between each, with `git diff` on the production files
confirmed empty after every revert.

The recurring failure was **degenerate fixtures**, where two different
inputs produce identical output so a swap cannot be seen:

| Surviving mutation | Why nothing noticed |
|---|---|
| chart the workflow series into `datasetLineChart` | both divs received
identical-looking data |
| exchange the two chart div ids | same |
| `sizePieChart` -> `datasetLineChart`, and `dataset.size` ->
`dataset.did` | the pie series was unpinned entirely |
| `getSharedModelAwareness()` -> `undefined`, and `cursors: true` ->
`false` | nothing read the binding's arguments back |
| the descriptor read for a different port id | only one port existed in
the fixture |
| `(click)` loses `connectQuillToText()`; `(focusout)` and
`(keyup.enter)` dropped | handlers were called directly, never through
the DOM |

**One error I caught in my own repair, and only because mutations were
run individually.** The first idempotence test asserted
`workflows.length`, which is *unchanged* when `this.workflows = []` is
dropped -- executions simply get re-filed under the existing panels.
Running the two resets as separate mutations exposed it; the test now
pins the per-workflow execution ids.

### Deliberately not included

Two defects are reported rather than pinned, so neither is cemented as a
contract:

- **The handshake drops `cuid` on a live path.**
`WorkflowWebsocketResource.myOnOpen` does
`session.getRequestParameterMap.get("cuid").get(0).toInt` with no
`Option` guard, while `admin-execution.component.ts:327, :340, :353` all
call `socket.openWebsocket(wid)` with no computing-unit id -- so admin
kill/pause/resume dial a URL the server cannot accept. The test that
observes today's URL is named descriptively rather than approvingly and
carries a note pointing at the gap.
- **`sortBySize` is inverted relative to the `NzTableSortFn` contract.**
`user-quota.component.ts:344-345` returns `b - a`, but ng-zorro applies
`sortOrder === 'ascend' ? compareResult : -compareResult` and
`nzSortDirections` defaults to `['ascend','descend',null]`, which the
`<th>` does not override -- so the first click lights the up-caret while
rendering largest-first. `admin-user.component.ts:268` uses the
contract-correct form, so this is not a house convention. The test
clicks twice and asserts row order *and* which caret is active in both
directions, with a comment stating the mismatch.

No production file is touched.

### Any related issues, documentation, discussions?

Closes #7695

### How was this PR tested?

```
npx ng test --watch=false --include="**/user-quota.component.spec.ts" 
--include="**/port-property-edit-frame.component.spec.ts" 
--include="**/workflow-websocket.service.spec.ts"
```

```
 Test Files  3 passed (3)
      Tests  70 passed (70)
```

Coverage measured with `--coverage` on the same run. `yarn format:ci`
passes.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 5)

Report URL: https://github.com/apache/texera/actions/runs/31919496688

With regards,
GitHub Actions via GitBox

Reply via email to