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

   ### Task Summary
   
   Three more backend classes have genuinely untaken **branch** arms (~29 real 
partial branches between them). Codecov computes `coverage = hits / lines` and 
does not count a partially-covered line as a hit, so each missing arm costs 
percentage points: roughly **+6.1pp / +6.1pp / +9.2pp** on the respective files.
   
   **Goal: take the untaken side of each conditional so these files reach full 
coverage.** All three already have a spec; extend it and re-run the coverage 
report to confirm the partials cleared. `AnyFlatSpec` + `Matchers`.
   
   (Reading the report: scoverage marks every `case` label partial, so the arms 
below were filtered to those whose body is *also* uncovered — each is genuinely 
never taken.)
   
   ### Behavior to add
   
   **SQLSourceOpExec** 
(`common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/sql/SQLSourceOpExec.scala`,
 ~84%, 10 real partials)
   - The result `Iterator[TupleLike]`: `hasNext`'s `case Some(_) => true` vs 
`case None =>` and the `next()` path — drive a result set that yields rows, one 
that yields none, and one that is exhausted mid-iteration.
   - The keyword-search guard `… && desc.keywordSearchByColumn.orNull != null 
&& keywords != null` — cover each half being null as well as both set.
   - The remaining `case None =>` arm on the same path.
   - **Stub the JDBC boundary in-process, as PR #6888 did for the 
MySQL/PostgreSQL execs**: register a stub `java.sql.Driver` with 
`DriverManager` and subclass the exec, so no database is involved.
   
   **PveManager** 
(`amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala`,
 ~84%, 12 real partials — scope to the pure helpers)
   - `isValidPveName`: `name != null && name.length <= 128 && 
SafePveName.pattern.matcher(name)…` — cover null, an over-long name, a name 
failing the pattern, and a valid one, so each conjunct decides the result at 
least once.
   - `if (SystemUtils.IS_OS_WINDOWS)` — the interpreter-path branch. Assert the 
path built for the current OS, and cover the other arm by calling the 
path-building helper with the OS flag injected/parameterised if it is 
reachable; otherwise assert only the arm the test platform takes and note the 
other as OS-specific.
   - Path containment and executable resolution: `if 
(!resolved.startsWith(root)) return None` — a path that escapes the root 
(traversal attempt) and one inside it; `if (Files.exists(resolved) && 
Files.isExecutable(resolved)) Some(resolved)` — cover missing, 
present-but-not-executable, and present-and-executable using a 
`Files.createTempDirectory` fixture.
   - `case Some(p) => p` and its `None` counterpart on the interpreter lookup.
   - **Out of scope**: anything reached through `runProcess` (`createCode` / 
`installCode` / `freezeCode`) — those spawn real `pip`/`venv` processes and 
belong to the integration tier.
   
   **DPThread** 
(`amber/src/main/scala/org/apache/texera/amber/engine/architecture/worker/DPThread.scala`,
 ~77%, 7 real partials)
   - `if (dpThread == null)` — call the start path twice so both the "not yet 
started" and "already running" arms run.
   - `case err: Throwable =>` — make the submitted work throw and assert the 
error is captured/reported rather than escaping.
   - `case WorkflowXWorker.TimerBasedControlElement(control) =>` — feed that 
element kind through the queue alongside a regular one so both match arms run.
   - `case None =>` on the input-selection path — an empty/exhausted channel.
   - `if (backpressureStatus)` — toggle backpressure on and off and assert the 
resulting flow-control decision.
   - Determinism: drive the logic **synchronously** — inject a same-thread 
executor (or call the internal step directly) rather than starting the real 
`dpThreadExecutor` and waiting on it; do not add sleeps or wall-clock waits.
   
   ### Task Type
   
   - [ ] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [x] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [ ] Other
   


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