The GitHub Actions job "Benchmarks" 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:
363537e0251182472f540079d262599f6cbb5240 / Meng Wang <[email protected]>
test(amber, workflow-operator): take the untaken branch arms in PveManager and 
SQLSourceOpExec (#7699)

### What changes were proposed in this PR?

Takes the untaken side of the conditionals in the two files #7698 lists.
12 new tests.

**PveManager** — the two pure guards. The create/install flows above
reach them
incidentally; these decide each conjunct directly.

- `isValidPveName`: null, a name over 128 characters (with 128 itself
pinned as
allowed), characters outside the safe set, the empty string, and a valid
name — so
  each of the three `&&` operands decides the result at least once.
- `getPythonBin`: a name outside the safe set (rejected before any disk
access), an
interpreter that has not been created, one that exists but is not
executable, and one
  that exists and is executable.

**SQLSourceOpExec** — the result iterator and the keyword binding,
driven against a
mocked JDBC chain.

- The iterator over a multi-row result set: one tuple per row, a second
`hasNext` that
does not consume the cached tuple, and exhaustion once the rows run out
and no further
  query is available; plus a query that returns no rows at all.
- The keyword guard `keywordSearch && keywordSearchByColumn != null &&
keywords != null`
in all four shapes, asserting the bind happens only when all three hold.

The spec's existing `TestSQLSourceOpExec` already overrides
`establishConn()`, so the
mocked `Connection`/`PreparedStatement`/`ResultSet` go in through that
seam rather than by
registering a stub `java.sql.Driver` with the global `DriverManager` as
the issue
originally suggested — same hermetic result, no global state.

No production code was changed.

### One guard that cannot be reached

`getPythonBin`'s `if (!resolved.startsWith(root)) return None` is
unreachable as written:
the name must match `^[A-Za-z0-9._-]+$`, so it is a single path segment
with no separator,
and `..` climbs at most to the root itself before `pve/bin/python` is
appended — the result
always starts with the root. The test named for the traversal attempt
therefore covers the
*pattern* guard on the line above it, which is what actually rejects
such a name.

### Any related issues, documentation, discussions?

Closes #7698.

The issue originally also listed `DPThread`; it has been removed from
the issue, since
every arm it named lives inside `runDPThreadMainLogic()` —
`private[this]`, so unreachable
from a test — and `start()` constructs
`Executors.newSingleThreadExecutor` inline with no
seam to inject a same-thread executor. The one synchronously reachable
item there,
`handleActorCommand`'s two arms, is already covered by `DPThreadSpec`.
Covering the rest
needs a production seam and belongs in its own refactor issue.

### How was this PR tested?

`sbt "WorkflowOperator/testOnly *SQLSourceOpExecSpec"` — 64 pass;
`sbt "WorkflowExecutionService/testOnly *PveResourceSpec"` — 44 pass.
The failure path was
verified by breaking one assertion in each spec (red, non-zero exit) and
restoring them.
`Test/scalafmtCheck` and `Test/scalafix --check` are clean on both
modules.

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

Generated-by: Claude Code (Opus 4.8 [1M context])

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

With regards,
GitHub Actions via GitBox

Reply via email to