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

   ### What changes were proposed in this PR?
   Several specs in `workflow-core`, `workflow-compiler` and `amber` repeated 
their fixtures case by case. Each spec family now shares them:
   
   - **Tuples.** `SchemaSpec` builds its attribute lists and schemas through 
`attrs` and `schemaOf`, and `TupleUtilsSpec` builds its tuples and single-field 
JSON through `tupleOf` and `singleFieldJson`.
   - **Iceberg result storage.** `LocalHadoopIcebergSpecSupport` gives 
`IcebergTableWriterSpec` and `OnIcebergSpec` their own Hadoop catalog in a 
temporary warehouse, with shared table, writer and tuple fixtures. The 
`workflow-core` `IcebergDocumentSpec` builds its documents through 
`newDocument`, `newDocumentWith` and `newCountingDocument`, and 
`IcebergUtilSpec` checks its three record round trips through 
`verifyTupleRecordRoundTrip`. In `amber`, `VirtualDocumentSpec` writes through 
`withWriter`, and the `IcebergDocumentSpec` companion holds the all-types 
schema, tuple builder and port URIs that `IcebergTableStatsSpec` also uses.
   - **S3 and large binaries.** `S3BucketTestBase` creates each suite's bucket, 
`LargeBinaryManagerSpec` writes and reads its payloads through 
`createLargeBinary` and `readLargeBinary`, and `S3StorageClientSpec` reads 
objects back through `downloadBytes`.
   - **Serde, links and reflection.** `GlobalPortIdentitySerdeSpec` and 
`PortIdentityKeyDeserializerSpec` check their failures through 
`deserializeFailure`, `serializeFailure` and `keyFailure`. 
`CoreExecutorReflectionSpec`'s fixture executors share `EmptyExec`, and 
`LogicalLinkSpec` checks its rejections and Jackson reads through shared 
helpers.
   
   Every test keeps its name, its inputs and its expected values. Only test 
code changes. Two cleanup differences: the two large-binary stream specs drop 
an `afterAll` that called `deleteDirectory(bucket, "")`, which rejects an empty 
prefix, so that cleanup always threw, was swallowed, and never deleted 
anything; and the three Hadoop-catalog cases in `IcebergUtilSpec` now close 
their catalog when done.
   
   ### Any related issues, documentation, discussions?
   Closes #9687.
   
   ### How was this PR tested?
   - The 17 suites these files belong to, with 
`AMBER_TEST_FILTER=integration-only` and `STORAGE_ICEBERG_CATALOG_TYPE=hadoop`: 
the 342 cases (286 in WorkflowCore, 23 in WorkflowCompiler, 33 in amber) have 
the same names, outcomes and order on main and on this branch, compared case by 
case from the JUnit XML reports. All pass apart from one case that is pending 
on both, and none was canceled. The S3 suites ran against a RustFS container 
through Testcontainers.
     ```
     sbt "WorkflowCore/testOnly org.apache.texera.amber.core.tuple.SchemaSpec 
org.apache.texera.amber.core.tuple.TupleUtilsSpec 
org.apache.texera.amber.core.storage.result.iceberg.IcebergDocumentSpec 
org.apache.texera.amber.core.storage.result.iceberg.IcebergTableWriterSpec 
org.apache.texera.amber.core.storage.result.iceberg.OnIcebergSpec 
org.apache.texera.amber.util.IcebergUtilSpec 
org.apache.texera.service.util.LargeBinaryManagerSpec 
org.apache.texera.service.util.S3StorageClientSpec 
org.apache.texera.service.util.LargeBinaryInputStreamSpec 
org.apache.texera.service.util.LargeBinaryOutputStreamSpec 
org.apache.texera.amber.util.serde.GlobalPortIdentitySerdeSpec 
org.apache.texera.amber.util.serde.PortIdentityKeyDeserializerSpec 
org.apache.texera.amber.core.executor.CoreExecutorReflectionSpec" 
"WorkflowCompiler/testOnly 
org.apache.texera.common.compiler.model.LogicalLinkSpec" 
"WorkflowExecutionService/testOnly 
org.apache.texera.amber.storage.result.iceberg.IcebergDocumentSpec org.apac
 he.texera.amber.storage.result.iceberg.IcebergTableStatsSpec 
org.apache.texera.amber.storage.result.iceberg.IcebergDocumentConsoleMessagesSpec"
     ```
   - Mutation check: breaking one or two shared helpers in each family fails 
136 of the 342 cases, in 16 of the 17 suites (108 in WorkflowCore, 8 in 
WorkflowCompiler, 20 in amber). The breaks were reversed `attrs` and 
`schemaOf`, a dropped row in the Iceberg document writes and table reads, a 
reversed round-trip expectation, a `withWriter` that never closes its writer, 
an `S3BucketTestBase` that creates no bucket, a payload write missing its first 
byte, failure helpers that call nothing, `LogicalLinkSpec` helpers that read or 
build a valid link, and an `EmptyExec` that declares a setting. 
`LargeBinaryOutputStreamSpec` stays green under them because the output stream 
creates its own bucket.
   - `sbt "WorkflowCore/Test/scalafmtCheck" 
"WorkflowCompiler/Test/scalafmtCheck" 
"WorkflowExecutionService/Test/scalafmtCheck" "WorkflowCore/Test/scalafix 
--check" "WorkflowCompiler/Test/scalafix --check" 
"WorkflowExecutionService/Test/scalafix --check"`
   
   ### Was this PR authored or co-authored using generative AI tooling?
   Generated-by: Antigravity (Gemini) and Claude Code (Claude Opus 5.5)
   


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