The GitHub Actions job "Required Checks" on texera.git/main has failed.
Run started by GitHub user github-merge-queue[bot] (triggered by 
github-merge-queue[bot]).

Head commit for run:
a61e1ee4a8b08f196cf509171d6372f7ab5895b8 / Xinyuan Lin <[email protected]>
test(agent-service): pin the context serializer and the execution tools (#7505)

### What changes were proposed in this PR?

`context-utils.ts` builds the prompt the agent reasons over and
`workflow-execution-tools.ts` turns
an execution result into the table it reads back. Both looked reasonably
covered and were not:
`bun` credits a whole function body once entered, so blocks inside
`jsonToTableFormat` and
`executeOperatorAndFormat` counted as covered while nothing asserted
them.

Adds 15 tests across the two existing specs (no new spec files — one
spec per source class, both
already existed).

| File | Before | After |
|---|---|---|
| `context-utils.ts` | 60.00% funcs / 77.83% lines | **100% / 100%** |
| `workflow-execution-tools.ts` | 58.97% funcs / 91.24% lines | 85.71% /
95.16% |

**Ten of the killed mutations target lines `bun` already called
covered** — the DAG topological
ordering and its target-rank tie-break, port-ordinal mapping, the
`NULL`/`null`/`undefined`/object
cell rendering, the row-gap ellipsis, the leading-tab header, and the
schema-violation messages.
The file percentage barely moves for those; the pinning is the point.

### Verification

45 mutations were applied to the production files and reverted, each
revert confirmed with
`git diff --quiet` before the next. All 45 turned the suite red.

An adversarial re-check then found **two assertions that were vacuous
anyway**, which is the part
worth reporting:

| Survivor | Why it passed | Fix |
|---|---|---|
| `Math.ceil` → `Math.round` on the execution timeout | the fixture was
`4500 ms`, and `ceil(4.5) == round(4.5) == 5`, so the assertion
commented "rounds up" proved nothing | fixture changed to `4200 ms`,
which separates ceil (5) from round and floor (4) |
| `getConfig()` hoisted out of the `execute` closure | the test invoked
the tool once, so `toHaveBeenCalledTimes(1)` holds whether the config is
resolved per invocation or captured once at construction | invoke twice
with the workflow id changing in between, and assert the second request
URL reflects the second config |

Both mutations are now red, and so is `Math.floor`. Production diff
empty.

### Deliberately not included

Three regions of `workflow-execution-tools.ts` are left uncovered
because they are dead, confirmed
by inserting `throw new Error(...)` at the top of each and running the
whole 273-test module — all
still passed, so nothing reaches them:

- `formatWorkflowValidationErrors` (169–178) — no call site.
- lines 221–226 and 229–233.

Testing them would cement code that should be deleted instead.

No production file is touched.

### Any related issues, documentation, discussions?

Closes #7504

### How was this PR tested?

```
bun test
```

```
 273 pass
 0 fail
```

15 new on top of the existing 258. `bun run typecheck` and `bun run
format:check` both pass.

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

Generated-by: Claude Code (Opus 5)

Co-authored-by: Meng Wang <[email protected]>

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

With regards,
GitHub Actions via GitBox

Reply via email to