aglinxinyuan opened a new issue, #5696:
URL: https://github.com/apache/texera/issues/5696
### Task Summary
Add dedicated unit-specs for three small storage-layer model classes in
`common/workflow-core/`. Pin defaults, equality, and trait conformance so
accidental drift in the result-store schema (`tupleCount`, `changeDetector`) or
in the `OnDataset` accessor surface is caught early.
## Background
Three small storage-layer model classes in `common/workflow-core` currently
lack a dedicated unit-spec:
| Source class | Package | Purpose |
| --- | --- | --- |
| `OperatorResultMetadata` | `core/storage/result` | Per-operator result
metadata: `tupleCount: Int = 0`, `changeDetector: String = ""` |
| `WorkflowResultStore` | `core/storage/result` | Map-wrapping case class:
`resultInfo: Map[OperatorIdentity, OperatorResultMetadata] = Map.empty` |
| `OnDataset` | `core/storage/model` | Trait with `getRepositoryName` /
`getVersionHash` / `getFileRelativePath` — accessor contract for dataset-backed
documents |
## Behavior to pin
### `OperatorResultMetadata`
| Surface | Contract |
| --- | --- |
| Default constructor | `OperatorResultMetadata()` has `tupleCount == 0` and
`changeDetector == ""` |
| Custom values | preserved via the case-class constructor |
| Equality | case-class equality compares both fields |
| `copy` | replaces only the field passed, preserves the rest |
### `WorkflowResultStore`
| Surface | Contract |
| --- | --- |
| Default constructor | `WorkflowResultStore()` has `resultInfo ==
Map.empty` |
| Equality | two stores with the same `resultInfo` are case-equal |
| `copy` | replaces `resultInfo` |
| Map carrying multiple operator metadatas | each key/value is preserved |
### `OnDataset`
| Surface | Contract |
| --- | --- |
| Trait declares three accessors | `getRepositoryName`, `getVersionHash`,
`getFileRelativePath` — all `(): String` |
| A test-only concrete subclass | returns each accessor's value verbatim |
| Pattern matching | a value of type `OnDataset` can be matched via
type-test for cross-module dispatch |
## Scope
- New spec files (one per source class per the spec-filename convention):
- `OperatorResultMetadataSpec.scala`
- `WorkflowResultStoreSpec.scala`
- `OnDatasetSpec.scala`
- No production-code changes.
- `OnDataset` is a trait; exercise it through a minimal test-only concrete
subclass.
### Task Type
- [ ] Refactor / Cleanup
- [ ] DevOps / Deployment / CI
- [x] Testing / QA
- [ ] Documentation
- [ ] Performance
- [ ] Other
--
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]