The GitHub Actions job "Benchmarks PR Comment" on texera.git/main has failed.
Run started by GitHub user zyratlo (triggered by zyratlo).

Head commit for run:
2d216ef3c663e6be7fd3fd50bf308c7c9b8fe9ed / 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/27647535709

With regards,
GitHub Actions via GitBox

Reply via email to