Repository navigation
Description
Task Summary
Two backend classes have genuinely untaken branch arms (~22 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 on the respective files.
Goal: take the untaken side of each conditional so these files reach full coverage. Both 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'scase Some(_) => truevscase None =>and thenext()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 test(workflow-operator): add unit tests for MySQL and PostgreSQL SourceOpExec #6888 did for the MySQL/PostgreSQL execs: register a stub
java.sql.DriverwithDriverManagerand 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 aFiles.createTempDirectoryfixture. case Some(p) => pand itsNonecounterpart on the interpreter lookup.- Out of scope: anything reached through
runProcess(createCode/installCode/freezeCode) — those spawn realpip/venvprocesses and belong to the integration tier.
DPThread was dropped from this issue. Every arm originally listed for it lives inside
runDPThreadMainLogic(), which isprivate[this]and therefore unreachable from a test, andstart()constructsExecutors.newSingleThreadExecutorinline with no seam to inject a same-thread executor — so neither route this issue suggested exists. The only synchronously reachable item,handleActorCommand's two arms, is already covered byDPThreadSpec's "toggle backpressureStatus on Backpressure and ignore other ActorCommands". Covering the rest needs a production seam (injectable executor, or the loop body extracted into something callable), which belongs in its own refactor issue.
Task Type
- Refactor / Cleanup
- DevOps / Deployment / CI
- Testing / QA
- Documentation
- Performance
- Other
Activity
[-]cover the untaken branch arms in SQLSourceOpExec, PveManager, and DPThread[/-][+]cover the untaken branch arms in SQLSourceOpExec, PveManager[/+]test(amber, workflow-operator): take the untaken branch arms in PveMa…