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

   ### What changes were proposed in this PR?
   
   Extract common test fixtures, schema builders, and assertion helpers across 
six UDF operator descriptor specifications into a shared 
`UdfDescriptorSpecSupport` trait:
   - `JavaUDFOpDescSpec`
   - `DualInputPortsPythonUDFOpDescV2Spec`
   - `PythonUDFOpDescV2Spec`
   - `PythonUDFSourceOpDescV2Spec`
   - `RUDFOpDescSpec`
   - `RUDFSourceOpDescSpec`
   
   The shared trait deduplicates:
   - Physical op construction (`buildPhysicalOp`)
   - Operator metadata validation (`expectOperatorInfo`)
   - Polymorphic JSON round-trip serialization / deserialization (`roundTrip`)
   - Worker count validation (`expectInvalidWorkerCount`)
   - Schema and column builders (`resultColumn`, `inputSchema`, 
`expectOutputColumns`)
   - Port description construction (`portDescription`)
   - UI and dataset parameter assertions (`uiParameter`, `datasetParameter`, 
`expectInjectedPython`)
   
   All 72 existing test cases, per-language code expectations, and assertions 
remain identical.
   
   | Metric | Before | After | Net Diff |
   | --- | --- | --- | --- |
   | Test files | 6 files (1,299 LOC) | 7 files (1,038 LOC) | -261 LOC |
   
   ### Any related issues, documentation, discussions?
   
   Closes #9414.
   
   ### How was this PR tested?
   
   Executed sbt test across all 6 refactored test suites:
   ```sh
   sbt "set DAO / Compile / sourceGenerators := Seq.empty" 
"WorkflowOperator/testOnly 
org.apache.texera.amber.operator.udf.java.JavaUDFOpDescSpec 
org.apache.texera.amber.operator.udf.python.DualInputPortsPythonUDFOpDescV2Spec 
org.apache.texera.amber.operator.udf.python.PythonUDFOpDescV2Spec 
org.apache.texera.amber.operator.udf.python.source.PythonUDFSourceOpDescV2Spec 
org.apache.texera.amber.operator.udf.r.RUDFOpDescSpec 
org.apache.texera.amber.operator.udf.r.RUDFSourceOpDescSpec"
   ```
   Output:
   ```
   [info] Total number of tests run: 72
   [info] Suites: completed 6, aborted 0
   [info] Tests: succeeded 72, failed 0, canceled 0, ignored 0, pending 0
   [info] All tests passed.
   ```
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Antigravity (gemini-2.5-pro)
   


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