aglinxinyuan opened a new pull request, #6078:
URL: https://github.com/apache/texera/pull/6078

   ### What changes were proposed in this PR?
   
   Add unit test coverage for `SQLSourceOpDesc.querySchema` — the abstract SQL 
source descriptor's JDBC schema-introspection path — selected from the Codecov 
report. No production-code changes.
   
   `SQLSourceOpDesc` (40.5% covered) is abstract; its concrete subclasses 
(MySQL/PostgreSQL/AsterixDB) never exercise `querySchema` because their specs 
supply no connection. The 27 missed lines are covered here via a small test 
subclass whose `establishConn` returns **ScalaMock-backed** 
`java.sql.Connection`/`DatabaseMetaData`/`ResultSet` — no live database.
   
   Covered:
   - the connection-field null guard (returns `null` until all fields set)
   - every JDBC-`Types` → `AttributeType` mapping arm (INTEGER/SMALLINT, 
DOUBLE/NUMERIC, BOOLEAN, BINARY, VARCHAR, BIGINT, TIMESTAMP)
   - default-port resolution via `updatePort()` and multi-column iteration
   - the unknown-data-type `RuntimeException`
   - the `SQLException` → wrapped-`RuntimeException` catch
   - the abstract base `establishConn` default (returns no connection → 
`NullPointerException`)
   
   ### Any related issues, documentation, discussions?
   
   Follow-up to the review feedback on #6043: prioritize tests that fill 
uncovered code paths.
   
   ### How was this PR tested?
   
   - `sbt "WorkflowOperator/testOnly *SQLSourceOpDescSpec"` — 16 tests, all 
green
   - `sbt "WorkflowOperator/Test/scalafmtCheck"` and `sbt 
"WorkflowOperator/scalafixAll --check"` — clean
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.8 [1M context])
   


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