The GitHub Actions job "Required Checks" on 
texera.git/gh-readonly-queue/main/pr-5699-2b9add956c9e63c3c4f6e717221a0c5e33e54875
 has failed.
Run started by GitHub user aglinxinyuan (triggered by aglinxinyuan).

Head commit for run:
5c6c91dc9fd54474d4a6c614defddf1305aa9bb7 / Xinyuan Lin <[email protected]>
test(workflow-core): add unit test coverage for storage result + dataset models 
(#5699)

### What changes were proposed in this PR?

Pin behavior of two previously-uncovered storage-layer model classes in
`common/workflow-core`. No production-code changes.

| Spec | Source class | Tests |
| --- | --- | --- |
| `OperatorResultMetadataSpec` | `OperatorResultMetadata` | 7 |
| `WorkflowResultStoreSpec` | `WorkflowResultStore` | 7 |

Both spec files follow the `<srcClassName>Spec.scala` one-to-one
convention.

> **Note:** an earlier revision also added `OnDatasetSpec`. Per review,
it was dropped — `OnDataset` is a pure abstract trait (three abstract
accessors, no behavior), so the spec only exercised test-only stub
subclasses rather than any production code. Only real implementations
warrant tests.

**Behavior pinned — `OperatorResultMetadata`**

| Surface | Contract |
| --- | --- |
| `OperatorResultMetadata()` | defaults to `tupleCount == 0` and
`changeDetector == ""` |
| Custom-constructor values | preserved on both fields |
| Equality | case-class equality compares both fields (differing values
break it) |
| `hashCode` | matches across equal instances |
| `copy` | replaces only the field supplied, preserves the rest |

**Behavior pinned — `WorkflowResultStore`**

| Surface | Contract |
| --- | --- |
| `WorkflowResultStore()` | defaults `resultInfo` to `Map.empty` |
| Custom map | every `(OperatorIdentity, OperatorResultMetadata)` entry
preserved; missing keys read as `None` |
| Equality | value-based on the inner Map; differing inner metadata
breaks equality |
| `copy(resultInfo = …)` | replaces the map without mutating the
original (immutable case-class contract) |
| `WorkflowResultStore()` vs `WorkflowResultStore(Map.empty)` | equal |

### Any related issues, documentation, discussions?

Closes #5696.

### How was this PR tested?

Pure unit-test additions; verified locally with:

- `sbt "WorkflowCore/testOnly
org.apache.texera.amber.core.storage.result.OperatorResultMetadataSpec
org.apache.texera.amber.core.storage.result.WorkflowResultStoreSpec"` —
14 tests, all green
- `sbt scalafmtCheckAll` — clean
- CI to confirm

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.7 [1M context])

Report URL: https://github.com/apache/texera/actions/runs/27582057761

With regards,
GitHub Actions via GitBox

Reply via email to